Yes of course, if you set the query argument ‘post_type’ to ‘any’, it will retrieve any type except revisions and types with ‘exclude_from_search’ set to true.
Example:
$all_posts = get_posts( array( 'post_type' => 'any' ) );
Otherwise, if you don’t want ALL post types, just certain ones:
$specific_posts = get_posts( array( 'post_type' => array( 'movies', 'books', 'videogames' ) ) );
Source: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
Related Posts:
- How To Remove These Stuffs From Custom Post Type List Screen?
- Sort custom post type list table by display name of a user id stored as post meta value
- Why does my custom taxonomy show a total count across all post types
- Add content in custom post type page after the title and before columns
- How to Remove Certain Screen Options and Table Columns from post type in wp_list_table?
- Add content before/after admin post wp-list-table
- WP_List_Table Inside Metabox Not Working on Submit
- Redirect after deleting post and keep track of pagination
- Add custom column at custom posts list
- Custom Post Type or Custom Tables
- How i add new link after Edit | Quick Edit | Trash | View in quick edit section
- Row actions not showing? Why?
- Is there a way to list posts of only a certain category
- How can I add a column in the wp_list_table of the admin area?
- How to use custom post type APIs, but use a different db table
- Add acf field in title (admin table)
- Default sort on admin columns with meta date hides draft posts with empty date value
- Show post in table front end
- Add custom column to post list table
- How to sort posts in a custom post type by title in ascending order by default?
- Programatically inserted posts not showing in Posts Table
- sortable columns for multiple custom post types not working
- How to add query args to links to CPT admin submenu
- Odd behaviour for the update button when displaying a WP_List_Table
- How to create a master without relying on posts table
- How to customize custom post type’s list table?
- Clone wp-admin/users.php (Users Admin Page)
- How to select meta key in custom database query
- Issue removing columns from admin table
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- Change column of row action (Quick Edit) links in WP_List_Table
- Custom taxonomy not showing up when adding a new custom post type
- Including Custom Post Types in “Recent Posts” Widget
- WP cron: when to schedule a 1-time event
- Pre get posts for single post
- Custom Posttype Inheritance (and url structure)
- How to get custom metabox image field?
- Custom Post Types – Capability Type
- Rewrite permalinks for custom posttype and custom taxonomy
- 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
- Adding a date archive to Custom Post Type
- Automatic category for a Custom Post Type
- Automatically check “Allow comments” for custom post type [duplicate]
- Trying to manage templates on a blog with lots of custom taxonomies
- Get the post children count of a post
- Link images to post permalink – custom post types
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Use get_post_types to query only custom posts types
- Rewrite WordPress URL to show CPT meta field data
- Set menu active state for custom posttype and category, given custom taxonomy term
- How to duplicate fields in custom post types?
- Custom Post Type Tag Capabilities Not Working
- Custom post type structure for posts with multiple child posts
- Hide parent categories when clicked, and show it’s childs
- Get unique superset of taxonomy terms from a list of custom posts in another hierarchical taxonomy
- current post index within content.php
- Multiple (two) category postings on the same page.
- Admin Column does not populate with data
- “Submit for review” for updates on existing posts
- Auto Complete Search
- Not getting posts of custom post types
- Custom post type pages return 404 page?
- Send a conditional email notification when a custom field value changes in Post Type
- Add custom CSS class to custom post type
- Custom taxonomy page returns 404
- portfolio custom type tags support
- Why does wp_update_post causes white screen?
- Targeting custom post type via functions.php doesn’t work
- Custom post type to lead to single post type instead of shortcode modal
- Filter posts of custom post type by meta key in (List All Section)
- is_main_query() never called on WP 4.4
- Change post type depending on shortcode
- Set Default Option Value as Blank for Meta Box
- Custom post type meta box empty after save
- How to add a class to meta boxes (to customize them in CSS)?
- custom post types missing ADD NEW
- adding page types in menu
- wp3 custom post types rss
- Custom Post Type Rewrite Throws Headers Sent Errors
- How to add comments to my custom post type but hide it from default WordPress Comments section?
- Custom post type rewrite slug translate?
- Dupplication of Custom Post Type while adding attachment
- Simple Data picker meta box
- Custom post template doen’t have any
- I have a problem with displaying children pages of custom post type
- Infinite scroll doesnt work
- When post is Published, insert into custom table a number – custom post type
- Is it possible to add a cpt that can only be viewed in backend, not edited?
- Custom taxonomy page template
- How do I put `tax_query` in this WP_query?
- How to display elements of different post types?
- Problem retrieving custom field for a custom post type
- Only One Post of Custom Post Type Appearing on Template Page
- Remove custom meta boxes from custom post type
- Filter page ID outside the loop and order
- the_post_navigation in single page with multiple taxonomies
- display related posts based on the PAGE TITLE