Firstly, do not use query_post()
, there almost never is reason to do so – take a look at When to use WP_query(), query_posts() and pre_get_posts.
Secondly, read the documentation about the things you want to achieve, here WP_Query – Type Parameters.
Thirdly, take a close look at what you’re writing/copying there might be a syntax error in it, that’s what you’re telling us is implying.
All that said, the following should do the trick.
Code:
$my_query = new WP_Query( array(
'post_type' => array( 'artwork', 'portfolio' )
) );
Related Posts:
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- register_post_type sort order by title by default
- Custom post types – Use post_id in permalink structure
- Rewrite custom post type rss feed links
- Populate Taxonomy from Custom Posts
- Show related posts on single page by custom taxonomy on custom post
- Remove unwanted part of permalink custom structure from CPT url?
- Changing a custom post type “has_archive” after registered
- Same base slug for CPT post and CPT taxonomy terms
- how to make custom posts sticky? [duplicate]
- Custom Post Type, Two categories, Two columns with Pagination
- Parent page for CPT
- Unable to get wp_redirect() working after adding a CPT via the front end
- Post Link Filter Help [closed]
- Custom Post Type slug same as page name causing a conflict
- Custom Post Type “Event” with custom permalink structure
- Getting a “Changes you made will be lost” dialog prompt on a custom post type page
- Why is my custom loop not filtering correctly nor paginating?
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Custom post types with custom directories
- How to associate two different post types (think Book and Chapter)
- Different Archive and Single Permalink URL
- Separate comment section for post type in dashboard
- GravityForm: Populate Dropdown with custom post type [closed]
- is there a way to retrieve posts that do not have a featured image assigned?
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Undefined Variable – Custom Post Type Meta
- Role capability delete multiple post type posts doesn’t work
- Custom post type archive page template
- Loop to fetch 3 post_thumbnail instances from 3 most recent custom post types named “portfolio”
- filter custom post type by meta key in dashboard
- Use a hierarchical custom post type for a main blog and subblogs?
- get custom post type
- I need to add endpoint for wordpress categories
- WordPress Custom Fields Won’t Save
- Meta Query Not Returning Output Despite Having Matching Values
- Using taxonomy term in CPT permalink – Pages 404’s
- Display a grid of taxonomy terms at root taxonomy page
- Custom Post Type Archive URL is wrong
- How to use custom template files in deeper directory?
- Display Custom Taxonomy Alphabetically
- Only show post if Author matches Logged in User
- Use “archive” as slug for custom post type
- Taxonomy in URL
- Warning: Invalid argument supplied for foreach() [closed]
- Custom post type isn’t working
- Add additional field to custom post_type
- Is it possible to filter the display name for post formats for display in the Formats meta box?
- Conditional for a Single Post That Belongs to a Category?
- Creating my own portfolio custom-type
- Author posts not appearing for custom post type
- Sort a custom post with ACF: Date Picker & Display Featured!
- How to concatenate two separate colums into one?
- Why content coming from single?
- Strip Characters From Tag Name
- What would be a proper name for a custom post type created for static content?
- Get taxonomy term by slug in post on archive page
- Displaying custom fields for custom post type generate with Custom Post Type UI Plugin
- Query not work for current taxonomy
- get_post_meta returns NULL in front-end, but correct result in back-end
- Replicating category/location page heirarchy
- 404 Page Not Found on /Page/2/ on Tag Page
- Custom Post Type homepage template
- Modifying WP_Title For Custom Post Type
- Types plugin custom post add_action hooks
- Copy/Move selected taxonomy terms to another taxonomy for posts
- All in one calendar custom post type query doesnt work as expected
- Better in the long run to use post date or custom taxonomy to sort/separate posts by year?
- Navigate by Tags inside a custom Post Type
- add_filter get array data before display in custom post_type
- On click some element i want to use some template
- WordPress Custom Post Loop
- programmatically generated custom post type is created more than once
- Button link display in shortcodes using custom field in ACF
- Peepso: Add extra data field (custom post meta) to postbox
- Create posts inside CPT post
- wp delete duplicate entries of custom post types every 15 minutes
- How do I link to a dynamic ACF button from a Custom Post type?
- How to hide sub fields in a field group and also the entire field group if the answer selected is “no”
- Show Post columns to specific users on condition
- Taxonomy to Post Type. Every Taxonomy Item can be Producer or Developer
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- How to use costum database table for custom post type
- connect users to Custom post types
- do action inside a class is not working
- Create an additional template page for every term taxonomy
- Custom Post Type Not Displaying Correctly
- How to solve performance issue caused by custom post type overview with 20k+ custom taxonomy terms
- Custom Post Type Pagination Not Working or Single Posts Displaying?
- Query Distinct Taxonomies of Custom Post Type
- Excerpt for each post type and for is_front_page
- Show taxonomies from specific CPT
- Custom metabox value not saving
- Category / Custom Post Type permalink issue
- How do i make a listing page of custom post type?
- strange conditional tag behaviour [duplicate]
- Comments are not working on Custom Post Type
- How to add to taxonomies to a post type
- Custom plugin contact form connecting to mailchimp API
- Update Custom Field daily within 7days