{"id":20867,"date":"2012-11-21T22:21:02","date_gmt":"2012-11-21T22:21:02","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/tw-pagination\/"},"modified":"2015-03-31T20:17:00","modified_gmt":"2015-03-31T20:17:00","slug":"tw-pagination","status":"publish","type":"plugin","link":"https:\/\/szl.wordpress.org\/plugins\/tw-pagination\/","author":7670054,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.1","stable_tag":"trunk","tested":"4.1.42","requires":"3.0","requires_php":"","requires_plugins":"","header_name":"TW Pagination","header_author":"Igor Vu\u010dkovi\u0107","header_description":"","assets_banners_color":"","last_updated":"2015-03-31 20:17:00","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/vuckovic.biz\/wordpress-plugins\/tw-pagination","header_author_uri":"http:\/\/vuckovic.biz","rating":5,"author_block_rating":0,"active_installs":1000,"downloads":29454,"num_ratings":7,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"8"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1753,170,3659,900,61933],"plugin_category":[43,44],"plugin_contributors":[79274],"plugin_business_model":[],"class_list":["post-20867","plugin","type-plugin","status-publish","hentry","plugin_tags-navigation","plugin_tags-page","plugin_tags-paginate","plugin_tags-pagination","plugin_tags-tw-pagination","plugin_category-customization","plugin_category-discussion-and-community","plugin_contributors-tweetysha","plugin_committers-tweetysha"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/tw-pagination.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>TW Pagination is a simple and flexible pagination plugin which provides users with better navigation on your WordPress site.<\/p>\n\n<p>In addition to increasing the user experience for your visitors, it has also been widely reported that pagination increases the SEO of your site by providing more links to your content.<\/p>\n\n<p>TW Pagination can also be used to paginate post comments!<\/p>\n\n<!--section=installation-->\n<p><em>Install and Activate<\/em><\/p>\n\n<ol>\n<li>Unzip the downloaded <code>tw-pagination<\/code> zip file<\/li>\n<li>Upload the <code>tw-pagination<\/code> folder and its contents into the <code>wp-content\/plugins\/<\/code> directory of your WordPress installation<\/li>\n<li>Activate TW Pagination from Plugins page<\/li>\n<\/ol>\n\n<p><em>Implement<\/em><\/p>\n\n<p>For posts pagination:<\/p>\n\n<p>1) Open the theme files where you'd like pagination to be used. Usually this is the <code>loop.php<\/code> file. For older version of WordPress, you may need to update the <code>index.php<\/code>, <code>archive.php<\/code> and <code>search.php<\/code> files.<\/p>\n\n<p>2) Replace your existing <code>previous_posts_link()<\/code> and <code>next_posts_link()<\/code> code block with the following:<\/p>\n\n<pre><code>&lt;?php if(function_exists('tw_pagination')) \n    tw_pagination();\n?&gt;\n<\/code><\/pre>\n\n<p>For comments pagination:<\/p>\n\n<p>1) Open the theme file(s) where you'd like comments pagination to be used. Usually this is the <code>comments.php<\/code> file.<\/p>\n\n<p>2) Replace your existing <code>previous_comments_link()<\/code> and <code>next_comments_link()<\/code> code block with the following:<\/p>\n\n<pre><code>&lt;?php if(function_exists('tw_pagination_comments')) \n    tw_pagination_comments();\n?&gt;\n<\/code><\/pre>\n\n<p><em>Configure<\/em><\/p>\n\n<p>1) Configure the TW Pagination settings, if necessary, from the TW Pagination option in the Settings menu<\/p>\n\n<p>2) The styles can be changed with the following methods:<\/p>\n\n<ul>\n<li>Add a <code>tw-pagination.css<\/code> file in your theme's directory and place your custom CSS there<\/li>\n<li>Add your custom CSS to your theme's <code>styles.css<\/code><\/li>\n<li>Modify the <code>tw-pagination.css<\/code> file in the tw-pagination plugin directory<\/li>\n<\/ul>\n\n<p><em>Note:<\/em> The first two options will ensure that TW Pagination updates will not overwrite your custom styles.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt>How can I override the default pagination settings?<\/dt>\n<dd><p>The <code>tw_pagination()<\/code> and <code>tw_pagination_comments()<\/code> functions each takes two optional arguments. \nSecond argument is in query string format, which allows you to override the global settings. The available options are:<\/p>\n\n<ul>\n<li>title - The text\/HTML to display before the pagination links<\/li>\n<li>nextpage - The text\/HTML to use for the next page link<\/li>\n<li>previouspage - The text\/HTML to use for the previous page link<\/li>\n<li>before - The text\/HTML to add before the pagination links<\/li>\n<li>after - The text\/HTML to add after the pagination links<\/li>\n<li>empty - Display before markup and after markup code even when the page list is empty<\/li>\n<li>range - The number of page links to show before and after the current page<\/li>\n<li>anchor - The number of links to always show at beginning and end of pagination<\/li>\n<li>gap - The minimum number of pages before a gap is replaced with an ellipsis (...)<\/li>\n<\/ul>\n\n<p>You can even control the current page and number of pages with:<\/p>\n\n<ul>\n<li>page - The current page. This function will automatically determine the value<\/li>\n<li>pages - The total number of pages. This function will automatically determine the value<\/li>\n<\/ul>\n\n<p>Examples (also applies to <code>tw_pagination_comments()<\/code>):<\/p>\n\n<p>1) To paginate custom WP_Query:<\/p>\n\n<pre><code>&lt;?php \n    $the_query = new WP_Query( $args ); \n    while($the_query-&gt;have_posts()) : $the_query-&gt;the_post();\n    \/\/ your code\n    endwhile;\n\n    if(function_exists('tw_pagination')) \n        tw_pagination($the_query, 'range=4&amp;anchor=2&amp;nextpage=Next&amp;previouspage=Previous');\n?&gt;\n<\/code><\/pre>\n\n<p>2) To paginate default WP_Query with custom settings<\/p>\n\n<pre><code>&lt;?php if(function_exists('tw_pagination')) \n    tw_pagination('global', 'range=4&amp;anchor=2&amp;nextpage=Next&amp;previouspage=Previous');\n?&gt;\n<\/code><\/pre>\n\n<p>3) To paginate default WP_Query<\/p>\n\n<pre><code>&lt;?php if(function_exists('tw_pagination')) \n    tw_pagination();\n?&gt;\n<\/code><\/pre><\/dd>\n<dt>How can I style the comments pagination differently than the posts pagination?<\/dt>\n<dd><p>When calling <code>tw_pagination_comments()<\/code>, TW Pagination adds an extra class to the <code>ol<\/code> element, <code>tw-pagination-comments<\/code>.<\/p>\n\n<p>This allows you to use the <code>.tw-pagination-comments<\/code> styles, already in <code>tw-pagination.css<\/code>, to override the default styles.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.1<\/h4>\n\n<ul>\n<li>Removed PHP4 constructor<\/li>\n<li>Code improvements<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"TW Pagination is a simple and flexible pagination plugin which provides users with better navigation on your WordPress site.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/20867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=20867"}],"author":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/tweetysha"}],"wp:attachment":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=20867"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=20867"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=20867"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=20867"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=20867"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=20867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}