wordpress Static Page pagination

This solution needs to be revised for that pagination functions are in functions.php. I am using Reverie master theme (which uses foundation framework), that theme uses pagination function which is in functions.php if( ! function_exists( ‘reverie_pagination’ ) ) { function reverie_pagination() { global $wp_query; $big = 999999999; // This needs to be an unlikely integer … Read more

Help With A Reverse Pagination Plugin

This function will give you a url for a page number without stripping the url for page 1: function get_pagenum_link_full($pagenum = 1, $escape = true ) { global $wp_rewrite; $pagenum = (int) $pagenum; $request = remove_query_arg( ‘paged’ ); $home_root = parse_url(home_url()); $home_root = ( isset($home_root[‘path’]) ) ? $home_root[‘path’] : ”; $home_root = preg_quote( $home_root, ‘|’ … Read more

Limit number of pages in pagination

Before I start, do not use get_posts for paginated queries. get_posts legally breaks pagination, and does not return the query object. If you need to paginate queries, use WP_Query As for your issue, I really don’t think limiting the total overall amount of posts to only 100 is possible when you involve pagination. The only … Read more

Passing custom args in paginate_links

To add arguments to the links in paginate posts, use the ‘add_args’ argument in the function. You have to pass the arguments as an associative array. So, to add project=1 to the end of all your links, you would do this: global $wp_query; paginate_links(array( ‘total’ => $wp_query->max_num_pages, ‘current’ => (get_query_var(‘paged’) ? get_query_var(‘paged’) : 1), ‘base’ … Read more

Broken pagination

I see a few issues that are probably contributing to your issue: Only ever use query_posts() to modify the primary Loop. The caller_get_posts parameter has been deprecated, in favor of ignore_sticky_posts The $wp_query variable is a defined global. Using it outside of its intended use may cause unintended circumstances. So, first, you need to determine … Read more

Custom post type archive with pagination?

As you can see in the rewrite analyzer, /projects/page/2/ sets projects=page&page=/2 instead of pagename=projects&paged=2 as we would like. So you just need to add a rewrite rule for this special case (in the register_projects() function, after you register your custom post type, would be a good place): add_rewrite_rule( ‘projects/page/([0-9]+)/?$’, ‘index.php?pagename=projects&paged=$matches[1]’, ‘top’ ); Remember to flush … Read more