It sounds like all you need to do is specify the 'post_type'
argument which is only 'post'
by default.
$posts = get_posts( array(
'category' => 16,
'post_type' => array( 'post', '{another_post_type}', '{another_post_type}', '{another_post_type}' )
) );
You might also consider using WP_Query
to make a custom loop instead. That’s a bit personal preference but is probably the best practice for what it looks like you’re doing.
Related Posts:
- get all posts from a custom post type
- Set post date before 1970
- Single loop for wp_query and wp_user_query
- Custom taxonomy not showing up when adding a new custom post type
- Including Custom Post Types in “Recent Posts” Widget
- query multiple taxonomies
- wp_set_object_terms() is not replacing term, but creating a new one
- Custom Posttype Inheritance (and url structure)
- Custom Post Types – Capability Type
- Create an archive page for custom taxonomies
- Using custom field as custom post title
- How to check if last uri segment is a custom post type or taxonomy term?
- Pass parameter to custom post type single while keeping clean url
- Pagination Doesn’t Work
- filter search result with custom post type meta key
- When you create a custom post type, does that also create capabilities for editing/deleting that post type automatically?
- Cleanest way to code “Custom Write Panels/Meta Boxes”?
- Adding a date archive to Custom Post Type
- Automatic category for a Custom Post Type
- Add an A-Z menu at the top of A-Z listing code
- Automatically check “Allow comments” for custom post type [duplicate]
- Trying to manage templates on a blog with lots of custom taxonomies
- How to register custom post types in a plugin?
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Get the post children count of a post
- Link images to post permalink – custom post types
- Having trouble with custom date field for CPT query (WordPress)
- How to retrieve custom field types for all posts in WordPress/PHP?
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Need functionality with all post list available at edit.php
- Add custom capabilities to existing custom post type
- Custom Post Type Post have a Child `Page` Post Type Post
- Use get_post_types to query only custom posts types
- pre_get_posts on custom post type
- How to duplicate fields in custom post types?
- Send email button in custom post type backend
- Custom Post Type Tag Capabilities Not Working
- Pagination for Custom Taxonomy Page [duplicate]
- Custom Post Type archive loop separated by term, in specific term order
- Paging doesn’t work?
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- Custom post type content using custom fields without template
- Hide post navigation if current post is in a category with only one post
- How to handle a CSV with 65,000+ rows and make it searchable?
- Remove CPT name from permalink but add %category% instead
- Get Posts by multiple custom fields is not working
- I want to change the word “Tags” in WordPress to something else, but how?
- How to query WordPress posts bycustom field with a max characters’ length
- Set post terms for multiple posts
- meta box on custom post type
- Categories filtering in new post
- “Post name” permalink returns home page for custom posts
- custom post type search by reference id
- how to check if custom post title exists or not?
- Print current post category during WP_Query
- Pagination custom post type not working with rewrite slug
- Pagination Not Working for Custom Taxonomy with Custom Query – 404 Error
- ACF repeater field usage
- Loop through posts of only 2 statuses
- Batch Extract Date from post title and put into ACF custom field
- custom query with custom post type and category slug
- Display custom post type for specific user
- WordPress as a backend for external service? [closed]
- Post query missing an elseif statement
- How to limit what Editors see in the admin?
- Update custom post type title
- Custom Post Type Archive Not Showing Posts
- Using a Single Custom Post Type Template for Multiple CPTs
- display custom post on separate page
- Post type Echo code is repeating on homepage
- Displaying custom taxonomy menu in custom post type archive
- How to display magic field’s custom write panel in wordpress theme?
- Admin slow on Postlist (over 30k Posts in Database)
- How can i show ACF in post excerpts
- Custom post type category link redirecting to 404 page
- Is it possible to hide nav menu items only when they are page titles (on specific templates) but not on the dashboard?
- Post category behave like a Post in back office menu
- My custom post type not show category
- How to output custom post type title on custom page with category next to it?
- Disable Sidebar on certain pages
- Add WordPress users to a custom post type
- Add new custom post type screen (admin area) results into 404
- Posts show up under “published” but not “all”
- Values show up in custom home page but not in custom post pages
- Permanent Custom Post Type
- Single Page of Custom Post Type Not Showing the Content Of post
- Organising custom taxonomies and custom post types
- “Trash”, “Draft” and count not showing for custom post type in admin panel
- Multiple loops for custom post type to spread data across rows
- Generate slug and meta data if meta field is empty
- Parent to another Custom Post Type – Template files not being recognized
- Redirect Custom Post Type after user submits update
- Taxonomy and Rewrite Structure
- Pagination for a Custom Taxonomy
- Trying to create hierarchy between 3-4 custom post types
- How do I sort post listing by child post count?
- 404 for children in hierarchical custom post type
- Searching for a single custom post type, buddypress
- Problem retrieving custom field for a custom post type
- Only One Post of Custom Post Type Appearing on Template Page