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
- How do you get the count of posts in an archive page?
- WP_Query by a category id and a custom post_type
- WP_Query ignores post_type in category view
- category__in not working on custom post type
- how do I group content in magazine-style ‘issues’?
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- How to show related posts by category or custom post type?
- New WP_query in template not working with CPT+category on some pages
- WP_Query post at custom position
- WP Query group/order by category name
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- exclude custom post type by meta key in wp_query
- Query for posts in 2 taxonomies
- WP_Query with custom post_type and cat retrieving unwanted posts with the custom posts
- Loop through categories and create tab for each
- How do I Use Nested Loops of Custom Post Types for MultiSite Blogs using WP_Query()
- Impossible to get Attachments Outside WordPress?
- Unable to get post content from custom post type loop
- Help Structuring Query for Archive Pages
- Loop on front-page.php
- wp_query to find posts by year and month
- Remove duplicated values from a loop
- Querying Term Posts in Loop
- Custom Post Type Loop within Shortcode
- How to connect two custom post types with nested loops
- Pagination on category page with custom post types
- Query custom post type in the loop
- Very Slow Page – How to Optimize # of Queries?
- How to show CPTs in term archive
- Display CPT posts based on specific taxonomy
- showing custom post types of a certain category only
- 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
- Show custom post type filtered by category
- Show a Category X’s custom post type on Category X archive page?
- Problem: wp_query outputs all images on site
- WP the_posts() on single-cars.php get category link
- How can I group posts by months and years?
- Multiple Custom Post Type queries, how to DRY it up
- Using wp_query to modify the loop in index.php for a CPT
- Custom WP_Query doesn’t display all posts
- Query & the_content() is showing in the header
- How to include category name/id in wp_query for retrieving “custom post type” from a particular category?
- Pagination not working on custom query on a page
- WP Query results showing posts outside of category ID
- How to get Custom Post Type with Categories wise in WordPress using wp_query
- Trying to add a class to post links
- get_terms() parent, child and grandchild
- Display post from custom post type
- Use post in multiple places on a page with multiple posts
- List all Custom Post Type posts excluding certain Taxnomy term
- How to properly use Categories with Custom Post Types
- Custom Post Type Query W/Category Dropdown
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Custom post type pagination error
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Page that lists publications by classifying them by taxonomy
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Exclude a specific post in a Custom Post Type
- Pin posts to top of custom loop
- Filtering posts based on three taxonomies
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- How to output custom post type title on custom page with category next to it?
- SEARCH QUERIES – REVERSE OUTPUT
- Custom WordPress theme not displaying posts from category
- Error in the page of a CPT file in WordPress
- post_type incorrect for custom post type
- Pagination for a cpt filtered with a category
- Staggering featured post using ‘sticky’
- Custom Post By Category
- Mix Facebook and Twitter feed into custom posts
- 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
- Custom post types not displaying per category
- Strange behavior on WP_query
- How To Loop Through list with Custom Post Types
- Can’t seem to filter wp_query by current category ID
- 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
- 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
- Get all custom_post_type posts + blog posts from one category in a single query
- 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?
- How can I show posts with the same tag?
- Query Multiple Post Types and Paginate Newly Created List
- SOLVED: Shortcode to display Divi project filtered by tag in WP Query loop