I am using this code to display custom post type.
$gabquery = new WP_Query();
$gabquery->query('showposts='.$showpostbotleft.'&post_type=courses' );
How to edit it to limit number of posts and specific taxonomy name of this custom post type.
I am using this code to display custom post type.
$gabquery = new WP_Query();
$gabquery->query('showposts='.$showpostbotleft.'&post_type=courses' );
How to edit it to limit number of posts and specific taxonomy name of this custom post type.
You must be logged in to post a comment.
I prefer using using the array form…
The above queries posts of type ‘courses’, limits the number of posts to be displayed to 5 per page, and selects only posts which belong to the ‘my-term-slug’ term of the ‘my-custom-tax’ taxonomy.
See the WP_Query Codex.