{"id":26125,"date":"2011-05-15T08:00:00","date_gmt":"2011-05-15T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/boones-pagination\/"},"modified":"2012-05-02T22:17:00","modified_gmt":"2012-05-02T22:17:00","slug":"boones-pagination","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/boones-pagination\/","title":{"rendered":"Boone's Pagination"},"content":{"rendered":"<p>Here\u2019s how I recommend using the class.<\/p>\n<ol>\n<li>Either activate this plugin, or include the class in your own plugin file.<\/li>\n<li>When you start to render the page with the post list, instantiate the pagination class, using an argument array if you\u2019d like: $pargs = array(   \u2018get_per_page_key\u2019 => \u2018perpage\u2019,   \u2018get_paged_key\u2019    => \u2018current_page\u2019,   \u2018per_page\u2019         => 15 ); $pagination = new BBG_CPT_Pag( $args );<\/li>\n<li>When constructing your query arguments (for query_posts() or WP_Query), you can use the class to get your pagination arguments out of the $_GET parameters. For instance: $args = array(   \u2026   \u2018posts_per_page\u2019 => $pagination->get_per_page,   \u2018paged\u2019 => $pagination->get_paged   \u2026 ); query_posts( $args );<\/li>\n<li>After firing the query, use the <code>setup_query()<\/code> method to populate the rest of the class. If you used <code>query_posts()<\/code>, you don\u2019t need an argument: $pagination->setup_query(); If you use <code>new WP_Query<\/code>, you\u2019ll have to pass the query object: $my_query = new WP_Query; $pagination->setup_query( $my_query );<\/li>\n<li>Then you can use all sorts of fun methods, like $pagination->paginate_links(); $pagination->currently_viewing_text();<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>A handy, extensible class for paginating your custom post type lists.<\/p>\n","protected":false},"author":65,"featured_media":244315,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Boone's Pagination - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"A handy, extensible class for paginating your custom post type lists."},"footnotes":""},"categories":[1],"tags":[744,4103],"class_list":["post-26125","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-custom-post-types","tag-pagination"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/26125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=26125"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/26125\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/244315"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=26125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=26125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=26125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}