paginate_links() with Custom Taxonomy
Looks like I was missing ‘paged’ => get_query_var(‘paged’) in the initial query.
Looks like I was missing ‘paged’ => get_query_var(‘paged’) in the initial query.
The issue ended up being the page in which I was accessing the shortcode on was using the same slug – which WP was freaking out about. While I’ll need to investigate why it would happen, was easy enough to fix.
Probably some code on your site caches the result of an expensive operation. When the page is cached by W3TC, if on the very same page generation, cache was being regenerated, you will see the actual queries that operation requires. After that, queries are like the usual page load ones. Don’t worry about it until … Read more
Try this one you need to add ‘paged’ => get_query_var(‘page’) so your code in $my_query should be like this $my_query = new WP_Query(array( ‘post_type’=>’post’, ‘posts_per_page’=>’1’, ‘paged’ => get_query_var(‘paged’) )); You just need to pass along the ‘paged’ query var from the main query: You can see also Codex page on query_posts()
Did you try this? $paged1 = (get_query_var(‘page’)) ? get_query_var(‘page’) : 1;
As of WordPress 3.6 you can put comma-delimited entries in the category_name property of the arguments array like this: $args = array( ‘category_name’ => ‘news2014,news2015’, ); query_posts($args); This works if the categories are both at the root level (no parent)
The problem was that one cannot apparently set ‘posts_per_page’ to anything other than what is set in the admin interface, even for a custom archive page. The same code, minus the ‘posts_per_page’ => ‘x’ line, works fine.
Try adding the type parameter: $args = array(‘post__not_in’ => $exclude, ‘ignore_sticky_posts’ => 1, ‘posts_per_page’ => 5, ‘meta_query’=> array( array( ‘key’=>’my_featured_post’, ‘value’=> 1, ‘type’ => ‘numeric’, // assuming your custom_value is an int, not a string. ‘compare’=>’!=’ ) ) ); $query = new WP_Query($args);
May be this will help: …….. …….. if(isset($_POST[‘genre’])) { $myquery = array( ‘showposts’ => 20 , ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘paged’ => $paged, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘anime_genre’, ‘terms’ => $_POST[‘genre’], ‘field’ => ‘slug’, ‘operator’ =>’AND’ ) ) ); } query_posts($myquery); ……
I’m not entirely sure why the get_posts() function works instead of creating a new instance of WP_QUERY. From what I understand about how WordPress queries work, get_posts() is actually creating it’s own instance of WP_QUERY anyhow. Either way, here is the solution that I’m using currently. <?php //GET THE PHOTOGRAPHERS $args = array( ‘post_type’ => … Read more