How to get query results for the next page
How to get query results for the next page
How to get query results for the next page
You are using default category for custom post type. You can instead use a taxonomy query to get filtered result based upon your custom taxonomy terms. Try this – $cat_ids = array(); $postID = get_the_ID(); $categories = get_the_terms($postID, ‘custom_taxonomy_name’); //this will give all the terms foreach($categories as $cat) { $cat_ids[] = $cat->term_id; //you may put … Read more
custom query – offset to pagination
Declare inline background image in functions.php
The syntax is not ‘post-type’ or ‘post-status’, it is with an underscore instead of a dash: ‘post_type’ => ‘testimonials’, ‘post_status’ => ‘publish’,
Ok, found the issue. By analizing the generated query, I realized that it rightly searched for current language posts. I’m currently use polylang as the multilingual plugin, and it correctly associate posts with a ‘language’ taxonomy. Now, I had far more 10 project posts but only 10 where of the current language. All fine now.
You mentioned you are using a custom taxonomy – therefore including the cat key in your wp_query args won’t work. wp_query expects that to be the ID of a term belonging to the standard WP category taxonomy. With a custom tax you need to use the dedicated taxonomy parameters. So your args should be something … Read more
Maybe you can try with get_posts() and foreach loop for the second query instead of WP_Query and then you will have something like this: <?php $secondary_query = get_posts(‘category_name=students’); foreach($secondary_query as $secondary_post): echo “<li>” . get_the_title($secondary_post->ID) . “</li>”; endforeach; ?> With above like style you don’t need wp_reset_query() just make sure you pass the post ID … Read more
By using those named GET variables such as year or monthnum you effectively short circuit the URL rewrite (if you are using pretty permalinks). This way you end up querying the main WP_Query instance first and effectively making yours completely useless (well, you do alter the posts_per_page attribute so there’s that). Anyway, the point is … Read more
What method does this eventually call: do_action_ref_array( ‘parse_query’, array( &$this ) );