Plugin này chưa được cập nhật với 3 phiên bản mới nhất của WordPress. Nó có thể không được hỗ trợ và bảo trì, và có thể xung đột với các phiên bản WordPress mới nhất.

Carbon Pagination

Mô tả

A handy WordPress library for building all kinds of paginations.

Provides the theme and plugin developers an easy way to build and implement highly customizable paginations, specifically tailored to their needs.

This plugin supports 4 types of pagination (you can easily extend the library if you need to create a new type of pagination):

Bài viết

The most common pagination type. Used for paginating through post listings in non-singular context – usually on the posts page, on all types of archives and on search results. This pagination uses the current global $wp_query, which means you can use it together with your custom query loops as well.

Viết bài

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.

Góp ý

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.

Custom

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.

Configuration

The following example is the most basic way to display a posts pagination (see Configuration Options for all types of pagination), using the default options:

<?php carbon_pagination('posts'); ?>

If using Carbon Pagination as a plugin, it would be best to check if the function exists:

<?php 
if ( function_exists('carbon_pagination') ) {
    carbon_pagination('posts'); 
}
?>

The carbon_pagination() function is a wrapper around the Carbon_Pagination_Presenter class, which handles pagination presentation. Which means you can also do the above this way:

<?php Carbon_Pagination_Presenter::display('posts'); ?>

Of course, if using Carbon Pagination as a plugin, it would be best to check if the class exists:

<?php 
if ( class_exists('Carbon_Pagination_Presenter') ) {
    Carbon_Pagination_Presenter::display('posts');
}
?>

For additional configuration and developer documentation, you can visit the Github repository:

https://github.com/2createStudio/carbon-pagination

Ideas and bug reports

Any ideas for new functionality that users would benefit from are welcome.

If you have an idea for a new feature, or you want to report a bug, feel free to do it here in the Support tab, or you can do it at the Github repository of the project:

https://github.com/2createStudio/carbon-pagination

Đánh giá

3 Tháng Chín, 2016
Excellent plugin!!! Works great, easy to use & has many options, simply the best pagination plugin I have ever worked with.
3 Tháng Chín, 2016
This is definitely the best pagination plugin! Works great in all situations, has all kinds of options that you might need, and code quality exceeds any expectations!
Đọc tất cả 3 đánh giá

Người đóng góp & Lập trình viên

“Carbon Pagination” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.

Những người đóng góp