开发者 |
2create
tyxla |
---|---|
更新时间 | 2016年4月12日 05:30 |
PHP版本: | 3.8 及以上 |
WordPress版本: | 4.5 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
$wp_query
, which means you can use it together with your custom query loops as well.
Post
Used for paginating through posts in singular context. Usually used on single posts - single.php
, but can be used to paginate through entries of any registered post type (including built-in ones like page
). Uses the global $post
to determine the current post and paginates through all of the rest posts of the same post type. You can filter the query that retrieves all posts by using the carbon_pagination_post_pagination_query
filter - please refer to the Actions & Filters section for more information.
條評論
Used for comments pagination on a given post. Usually used on single.php
when comments pagination is enabled in Settings -> Discussion, but can be used on posts in non-singular context as well. Of course you would have to do the following to be able to list comments in non-singular loops:
global $withcomments;
$withcomments = true;
This pagination type supports a comments pagination on the comments of a post of any registered post type.
习惯
Used for creating custom flexible paginations. You can specify the total number of pages and the current page by yourself. Also, you'd have to specify the query var that is used to build the pagination links (by default page
is used).
If you don't specify a current page and total number of pages, this pagination type can be used for content pagination on a single post of any post type (including page
). Content can be paginated by using the default WordPress quicktag.
If you need a more complex custom pagination, you'd probably want to extend this pagination type - it is being represented by the Carbon_Pagination_Custom
class.
composer install
on Windows OS
1.1.1
Tested with WordPress 4.4.
1.1
Introducing carbon_pagination_render_item_html
filter hook.
Introducing carbon_pagination_before_setup_item
action hook.
Introducing carbon_pagination_after_setup_item
action hook.
Implemented {TITLE}
token for the items within Carbon_Pagination_Post
.
Test coverage for all of the above.
Carbon_Pagination_Post
code polishing.
1.0
Initial version.