Are these custom taxonomies or the regular categories?
if they are just categories you should use:
$args = array(
'posts_per_page' => -1,
'post_type' => 'news',
'orderby' => 'date',
'order' => 'DESC',
'category_name' => 'Alumni'
);
$loop = new WP_Query( $args );
<?php while ( $loop->have_posts() ) : $loop->the_post();?>
...
<?php endwhile; ?>
if you want to use it by id
use:
'cat' => 160
instead of
'category_name' => 'Alumni'
Related Posts:
- WP Query with categories only shows one post and ignores the category
- Only show current category post
- Custom Post Type + Category archive
- Display all posts in a custom post type, grouped by a custom taxonomy
- How do you get the count of posts in an archive page?
- WP_Query by a category id and a custom post_type
- Exclude a category from WP_Query
- How to use a custom post type as front page?
- WP_Query ignores post_type in category view
- Display several random posts, but make sure a condition is met
- category__in not working on custom post type
- how do I group content in magazine-style ‘issues’?
- Filter by custom taxonomy slug on a custom post type
- Pagination on category page with custom post types
- Query custom post type in the loop
- Loop through Custom Post Type, and then show children within each iteration
- Very Slow Page – How to Optimize # of Queries?
- Can I create a loop with multiple post types and specify different $args for each post type?
- How to show CPTs in term archive
- Display CPT posts based on specific taxonomy
- showing custom post types of a certain category only
- WP_Query orderby modified to include custom meta changes
- Linking to the most recent post in a Custom Post Type
- How to make sure content doesn’t display if selection is empty
- Show one item per category of a custom post type
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- Show custom post type filtered by category
- Custom loop with multiple taxonomy queries
- forming WP_Query for posts of all post types but from specific categories
- Show a Category X’s custom post type on Category X archive page?
- Custom post type, organized by categories
- What’s the WP way to load remaining custom posts?
- Problem: wp_query outputs all images on site
- Why is my category template ignoring post type?
- pagination not working for category.php (custom post types in categories)
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- WP the_posts() on single-cars.php get category link
- Wrapping x posts in html without leaving empty html
- WP Query post__in not returning correct results
- Sort posts in loop by the WooCommerce Membership of the author
- Tag page only display 10 posts
- How can I group posts by months and years?
- Multiple Custom Post Type queries, how to DRY it up
- Custon Content within WordPress Loop
- Loop increase number
- Using wp_query to modify the loop in index.php for a CPT
- WP_Query Custom Post Type if Category ID Equals
- Custom post types and ‘new WP_Query’
- Custom WP_Query doesn’t display all posts
- Query & the_content() is showing in the header
- get_pagination not working on a custom post type query (using WP_Query)
- WP_Query with custom post type ID
- How to include category name/id in wp_query for retrieving “custom post type” from a particular category?
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Pagination not working on custom query on a page
- Custom post Query and WordPress Post Query Clash
- Only show categories that have posts within custom post type
- Query the title of the page to show posts with matching category in the loop
- Excluding category from loop not working
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- Custom post types not displaying per category
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Error in WP Query. If variable is empty it is displaying previous post value
- Strange behavior on WP_query
- get_post_meta for Custom Post Type ( CPT )
- How To Loop Through list with Custom Post Types
- Can’t seem to filter wp_query by current category ID
- Is it possible to add query parameters on the archive page?
- Loop with Custom Post Type and Taxonomies
- display news with pictures 3 small and one large (loop)
- How to query all custom posts of a certain type and checking what category they have
- Post data in separate divs with incrementing class using WP_Query
- How can I pull information from my loop and divide them seperately?
- category_name not working in WP_Query
- Fallback if statement based on the number filtered from it
- next_posts_link returns same content of 1st page
- Custom loop won’t work, can’t find problem
- Custom post-type’s pagination not working in category.php
- Categories and page filtering with pre_get_posts
- Query Custom Post Type by Tag
- Fourth page of custom post type archive page does not exist
- Get all custom_post_type posts + blog posts from one category in a single query
- Catergory args causing loop not to show
- Using tax_query to get single post per category
- How do I correctly query posts from a post ID?
- display custom post type from register taxonomy
- How to exclude certain portfolios from a loop
- Custom post type and have_posts() return empty result
- display all posts in current category
- Are custom posts included when getting a categories’ posts?
- Is it possible to make is_category() recursive?
- How can I show posts with the same tag?
- How to insert a post from a different post type after every nth post
- Complex Custom Loop with Includes
- Query Multiple Post Types and Paginate Newly Created List
- WP Query filtering by custom category not showing all relevant posts
- SOLVED: Shortcode to display Divi project filtered by tag in WP Query loop
- author archives, showing all custom post types, problem on pagination