So I went ahead and did the multiple loop thing, as I had done before. I’m always interested in seemingly cleaner/simpler solutions, but sometimes you just have to keep moving. This is the code I’m using:
<?php
$args = array(
'post_type' => 'projects',
'project_category' => 'websites',
'orderby' => 'menu_order',
'showposts' => 1
);
$posts = get_posts( $args );
foreach ($posts as $post) : setup_postdata($post);
?>
// Get the post stuff here
<?php endforeach; wp_reset_postdata(); ?>
I can repeat this as needed, changing the taxonomy (in this case the taxonomy is project_category) term each time.
Please feel free to comment an tell me if this isn’t a good way to do it. I’m far from an expert at the PHP side of WordPress.
Related Posts:
- Custom post types not displaying per category
- how do I group content in magazine-style ‘issues’?
- Alphabetical sorting of custom post type – one letter per page
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- How to show related posts by category or custom post type?
- Categories and Tags not working!
- Query Custom Post by Category
- Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy
- How to list custom post types?
- Display Next/Prev when looping Custom post-types archive?
- WP_Query | ‘post_type’ doesn’t work
- CPT Archive with core Category
- Custom post type templating problem
- Show a Category X’s custom post type on Category X archive page?
- Custom post type, organized by categories
- WP Query with categories only shows one post and ignores the category
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Tag page only display 10 posts
- get_terms() parent, child and grandchild
- Use post in multiple places on a page with multiple posts
- Custom Post Type Custom Archive Page Not Working
- Custom post type category permalinks and archive pages
- Show the categories the current post has
- Custom WordPress theme not displaying posts from category
- Pagination for a cpt filtered with a category
- Only show categories that have posts within custom post type
- get_permalink() of page the enclosing page not posts
- Excluding category from loop not working
- How to Show all Values in category.php page using post_type
- Only show current category post
- Help with Multi Level Category Archive Page
- Custom Post Type + Category archive
- How to query all custom posts of a certain type and checking what category they have
- How can I set up the URL for a category archive for a custom post type?
- Categories and page filtering with pre_get_posts
- display all posts in current category
- Show custom post type on post category page doesn’t work / breaks navigation
- Best practice to display a list/archive of Custom Posts in a Page Template
- Categorizing Custom Posts in Bulk Based on Title
- Get custom post type slug for an archive page
- Display all posts starting with given letter?
- Custom Post Type Settings page, choose page to display archive
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- wp_pagenavi() with custom wp_query()?
- How can I list all the categories under a Custom Post Type (taxonomy)?
- Custom Post Type Archives by Date with Custom Permalink
- category__in not working on custom post type
- automatically save custom post type title as a category
- IF statement in a do_shortcode
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- How can I filter by taxonomy on a custom post type’s page?
- Using pre_get_posts to filter one loop in a multiloop archive
- How to detect filter in URL in Category page?
- Replace li Items with divs with classes
- showing custom post types of a certain category only
- Custom post types and tag archive pages/permalink structure issue
- Loop custom taxonomy to get lists of cutom post types?
- Multiple level category drop-down from the WordPress dashboard
- How to create a gallery page with categories?
- Displaying Custom Posts on a Page
- can these 3 queries be re-written as 1 query?
- Custom Post Loop pulling all custom posts, not just one
- Wrapping x posts in html without leaving empty html
- How to retrieve category of a post in have_post loop?
- Post loop count is not in order
- Disable custom taxonomy on admin bar
- hide specific div on single.php [closed]
- Want a custom query with just one category but from all custom post types
- How do you output an unknown number of images in a custom post type with desired markup?
- Custom Post Type with modified permalink structure results in 404
- add_action ‘init’ from inside a class for custom post types
- Displaying information from custom field on custom post type
- Custom post type archive – error in nav-menu-template.php
- Custom Post type Query by Taxonomy
- How do I enforce a specific custom post type on the loop
- how to organize my categories or should I do custom post types for some?
- If/Else child list for Custom Post Type single template within loop?
- Multiple categories assigned to a single product breaking the breadcrumb
- Custom front-end form for adding post – Category problem
- Control over custom post types on a specific page
- Show custom post type event if current day using ACF
- How to create an IF statement in the Main Loop for Custom Post Types
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- How to output and alert message when updating a post
- Get meta values from parent post and save in child post
- Custom post pagination not working
- Custom post type loop without children
- How to display user-defined / custom post in wordpress?
- How to keep a CPT stick to specific position?
- how to use two permalinks for one custom post type based on categories
- Rewriting archive page slug to be different than custom post type slug
- Is it possible to add query parameters on the archive page?
- Custom post type archive pagination with HTML5Blank theme?
- Custom Catagory not found
- How can I list custom post by custom category?
- how to show perticular category posts in custome page
- Use only selected regular categories for a Custom post form
- 2 loops in archive.php (one for each category)
- Custom Post Types and 404 Pages