add_rewrite_rule – working fine but broken for pagination

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

how to get pagination link url?

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

Pagination resolving to first page only

Building off of what Rarst has said, I’m pretty sure the query string will retain ‘paged’ queries even if WP_Query strips it out as irrelevant. You could try replacing your query posts line with this: global $query_string; parse_str( $query_string, $my_query_array ); $paged = ( isset( $my_query_array[‘paged’] ) && !empty( $my_query_array[‘paged’] ) ) ? $my_query_array[‘paged’] : … Read more

get_query_var( ‘paged’ ) not working outside of homepage

twentyeleven_content_nav() uses the main query object, $wp_query. You’ll need to use the $wp_query variable, rather than $unfiltered_query, then wp_reset_query() to restore the original $wp_query (which it’ll find in $wp_the_query, something you should probably avoid touching directly). As long as you’re careful to restore the original query, you’re in good shape. I would submit a patch … Read more

get_query_var function not working at all

WordPress doesn’t automatically add all query string params ($_GET params) as query_vars. When Query Var somevar is not registered: example.com/some-page/?somevar=hello – WordPress ignores somevar When Query Var somevar is registered: example.com/some-page/?somevar=hello – WordPress stores the value of this param in the $wp_query->query_vars array The difference between registering that variable with WordPress is whether the value … Read more

The next_posts_link() works only with original $wp_query

next_posts_link and previous_posts_link use the global $wp_query. function get_next_posts_link( $label = null, $max_page = 0 ) { global $paged, $wp_query; http://core.trac.wordpress.org/browser/tags/3.5/wp-includes/link-template.php#L1523 That means you need to do something like this to get those to work correctly. $orig_query = $wp_query; $wp_query = new WP_Query($args); // the rest of your code $wp_query = $orig_query; If you are … Read more

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