You should use a custom select query:
$querystr = "
SELECT * FROM $wpdb->posts
LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id)
LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
LEFT JOIN $wpdb->terms ON($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id)
WHERE ($wpdb->terms.name="sounds-flavors" OR $wpdb->posts.ID IN(12345,12678))
AND $wpdb->term_taxonomy.taxonomy = 'category'
AND $wpdb->posts.post_status="publish"
AND $wpdb->posts.post_type="post"
LIMIT 3
";
Take a look here: https://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query
Regards
Related Posts:
- The next_posts_link() works only with original $wp_query
- Skipping first 3 posts in wp query
- posts page – different lengths of excerpt
- Pagination not working on Custom Page Template
- Specific loop in Shortcode
- how to show all post in my page-grid.php template page
- Adding variable for post title so post template can include auto-generated link to view on external website.com/{post title}
- Hide Post comments when displayed via WP_Query
- WP_Query do not load specifed number of post
- Single post as homepage?
- How can I pass the ID of a post to a page template by clicking a url?
- How to insert 2 args into 1 Wp_Query for a slideshow
- Switch to page template when using post permalink
- What’s the best way to render Visual Composer in posts, not pages?
- Get Page ID of blog homepage
- Using wp_list_pages() after calling query_posts()
- How to get ID of the page included with get_page()?
- Why won’t pagination work?
- Shortcode with ‘year’ parameter
- WordPress 302 Redirect to Random Product/Post/Page
- How to convert query sql to shortcode in wordpress?
- HTML Inside of Shortcode Breaks Shortcode Output
- post/page content
- Prevent 404 of Author pages without posts
- Change published date and time using SQL query for page in every 5 hour
- Function is printing twice – any suggestions?
- How to create page with post content in it?
- Page with Category Returning 1
- Single Sidebar; multiple templates! How?
- My blog “page” used to show a list of posts, but now it’s just showing the page content?
- Using Post ID and Page ID in same function
- How to arrange different post categories in template
- The next_posts_link() works only with original $wp_query
- how to style an individual page in a category [duplicate]
- Redirecting posts in WordPress to a specific page
- Limit amount of pages shown in pagination within wp_query
- How do I add an article to specific page?
- custom post type single page template not working
- WordPress “Posts Page” isn’t showing template dropdown
- Insert Shortcode exactly at the end of the content
- Trying to create shortcode listing custom posts, but formating not being included
- Stop WP from creating “Sample Page” and “Hello World!” post
- How to display by default only published posts/pages in the admin area?
- Adding additional data to WP_Post object
- Post/Page Preview Template
- Display posts by tag on page
- Most viewed post for the last 2 days using WP_Query
- Adding Post Counts to Menu (Nav) Programmatically?
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Creating new page with pre-defined parent page
- How To Add Perfect Apostrophe And Quotation Mark In WordPress Posts?
- wp query with dynamic taxonomies and terms?
- Blogroll – Different layout for first post
- disable column on post and user list
- How can I display widget in a Page or Post?
- Getting a 404 error when clicking edit page
- Automatic value for custom fields for posts
- Loop through all product posts?
- Category Template: Need to display different content on first page of archives
- Get Posts that are in the current month or later
- WP Query to Get Array of Slugs
- Lost draft under all posts and drafts
- Get user categories with most posts in it
- List authors with the last post title and order by last post date
- How to order posts by meta_value and title
- When open add new post or page WordPress add post with ID=0 continuously [closed]
- How to create a template for Pages?
- How do I do a page break?
- When changing pages to posts, how do you set up 301 redirects for the page URLs?
- Ignore latest two posts
- Print out last 3 blogposts
- static landing page leading to author specific pages w/ “live” content
- How to group only VISIBLE posts? [closed]
- wordpress posts template remove default template from menu
- On what hook can I get the queried object’s final state?
- Is it possible to add a shortcode below post title?
- Get all custom posts with a certain taxonomy
- Link to date_query results in WordPress
- Shortcode for tables which can include comma and linebreaks
- Direct some posts to only appear on a specific page
- Indenting within a blockquote
- How to allow WordPress to recognize a custom URL segment after a product URL and use a custom template?
- WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!
- How to add a block to a category page?
- Change archive results based on GET request
- calling pages instead of posts
- WordPress display page information rather than post
- Post Category link is same with Page link
- I need show posts by customer (Shortcode)
- Wp_query loop is not working as it should
- Show all posts from the tags without having to set all of them
- Creating Ordered Query using Meta_key
- How to change post template via url?
- WP Query between posts custom fields [duplicate]
- Add category attribute to custom recent post shortcode
- How to Include a common category in a custom Category Search
- wp_query posts sorting doesn’t work
- custom sort posts in archive/taxanomy page
- When and how will php code in a user made WordPress page be executed?
- WP_Query post_tilte search in posts table