paginate_links ignore my format

This part: ‘base’ => str_replace( 999999999, ‘%#%’, esc_url( get_pagenum_link( 999999999 ) ) ), is generating a page part like this one: ‘base’ => http://example.tld/page/%#%/ If we peek into paginate_links() we see the default: ‘base’ => $pagenum_link, // http://example.com/all_posts.php%_% : // %_% is replaced by format (below) ‘format’ => $format, // ?page=%#% : %#% is replaced … Read more

How to paginate the get_users function?

First get the total number of users: $total_users = count_users(); //var_dump($total_users); //for debugging purpose $total_users = $total_users[‘total_users’]; and the current page: $paged = get_query_var(‘paged’); Set a variable that will decide how many users to display per page: $number = 20; // ie. 20 users page page Then, in your $args array add the offset if … Read more

How to fix pagination after rewriting url? ie. www.site.com/players/type/pro/page/3/

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’);

paginate_links() adds empty href to first page and previous link

Have you tried specifying the base and format arguments for paginate_links()? It assumes the default values of: ‘base’ => ‘%_%’, ‘format’ => ‘?page=%#%’, Your base should be something like /parent-page/child-page/%_%; then the first page link will be to /parent-page/child-page/, and subsequent links will follow the format /parent-page/child-page/?page=3 (example for page 3). In the base, the … Read more

Pagination with custom post type not working

The pagination works only, if the paged attribute in the the global $wp_query variable is set. You could store your query manually in this global or just use query_posts() instead of new WP_Query(). <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $the_query = query_posts( array( ‘post_type’=>’article’, ‘posts_per_page’=>2, ‘orderby’=>’date’, ‘paged’=>$paged ) ); // … ?> The … Read more

Pagination returns 404 after page 20

What you are experiencing is quite normal and expected. This is one of the big reasons I always hammer on this point, never use custom queries to replace the main query on the home page or any type of archive page. They solve one issue but creates plenty other new ones Lets look at what … Read more

post pagination names, not numbers

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)