Pagination of RSS2 feed
You want to use paged not page in the request and it should work. You can find more information about WordPress pagination paged parameter here.
You want to use paged not page in the request and it should work. You can find more information about WordPress pagination paged parameter here.
EDIT – WORDPRESS 4.4.1 BUG Please take note that there is a bug in WordPress 4.4.1 (I’m not sure if this bug also influence WordPress 4.4, but according to the bug report, it does not) which fails pagination when setting a page as static front page. Be sure to check out the bug report (trac … Read more
Just inspect the current post content for <!–nextpage–>: function wpse_check_multi_page() { $num_pages = substr_count( $GLOBALS[‘post’]->post_content, ‘<!–nextpage–>’ ) + 1; $current_page = get_query_var( ‘page’ ); return array ( $num_pages, $current_page ); } On page 2 of 3 that returns: Array ( [0] => 3 [1] => 2 ) On an unpaged post it returns: Array ( … Read more
The current / total page count is set up by setup_postdata() which runs at the beginning of the loop. So, if you’re in the loop, all you have to do is this: global $page, $numpages; echo “Page $page of $numpages”; If you need to do that outside of the loop, do this first: global $page, … Read more
You have to add another rule which maps the /page/# to the &paged=# variable. Really though, you’re kinda doing it all backwards here by filtering the rules array. Just calling add_rewrite_rule to add your rules makes a bit more sense. function plugin_name_add_rewrite_rules() { add_rewrite_rule(‘players/type/([^/]+)/?$’, ‘index.php?post_type=players&type=$matches[1]’, ‘top’); add_rewrite_rule(‘players/type/([^/]+)/page/([0-9]+)?$’, ‘index.php?post_type=players&type=$matches[1]&paged=$matches[2]’, ‘top’); } add_filter(‘init’, ‘plugin_name_add_rewrite_rules’);
The text for <!–nextpage–> is hardcoded, so you can’t modify that specifically. wp_link_pages only works with consistent text, so I don’t think you can really make that do exactly what you want either, but it does accept a parameter echo which you can set to false to return the value. Leveraging that, there are plenty … Read more
Most likely, the main thing that you missed is that you must have “Break comments into pages” checked in the Settings Discussion Subpanel. The pagination functions require this to be set, as do the URL rewrites. Here’s a working, complete page template to do what you’re asking: <?php /* Template Name: All Comments See http://wordpress.stackexchange.com/questions/63770/aggregate-comments-with-pagination … Read more
Inside the loop, as michael pointed out you could just refer to $numpages global variable. Outside of the loop, your code is almost fine. Being the number of the pages the number of <!–nextpage–> + 1, you could save a function call by doing: $numOfPages = 1 + substr_count($the_post->post_content, ‘<!–nextpage–>’); As a quick and not-that-dirty … Read more
Have you tried: The main one: add_rewrite_rule( ‘region/([^/]+)/type/([^/]+)/?’, ‘index.php?taxonomy=region&term=$matches[1]&post_type=$matches[2]’, ‘top’ ); For pagination add_rewrite_rule( ‘region/([^/]+)/type/([^/]+)/page/([0-9]{1,})/?’, ‘index.php?taxonomy=region&term=$matches[1]&post_type=$matches[2]&paged=$matches[3]’, ‘top’ ); Out of curiousity, I replaced one of the ([^/]+) with the literal ‘type’ since that doesn’t seem to be a dynamic variable. If the pagination doesn’t work, try switching the order of when it’s declared, i.e. before … Read more
If you check out the source, they’re both wrappers around *_posts(), which in turn are wrappers for get_*_posts_page_link() (where the wildcard indicates either next or previous). For example, next_posts() will echo or return the escaped URL, depending on the first argument: $escaped_url = next_posts( false /* Don’t echo */ ); next_posts(); // Prints escaped URL … Read more