Hello bro try this will work !
$newsItems2 = get_posts( [
"post_type" => "post",
"post_status" => "publish",
"posts_per_page" => 3,
"orderby" => "date",
"order" => "DESC",
"meta_key" => "news__type",
"meta_value" => "general",
] );
Related Posts:
- Advanced orderby with multiple meta_query
- get_posts( $args ) return empty data
- How to sort custom posts including null meta-values in admin columns with meta_query?
- Get Posts from Custom Meta Query
- get posts meta query returning the latest post if no meta key found
- How to compare Event period with Week period using get_posts(), meta_query, relation and compare
- How to do a meta query using REST-API in WordPress 4.7+?
- Using meta_query, how can i filter by a custom field and order by another one?
- Meta query terribly slow
- ORDER BY custom field value
- Sorting: custom query with orderby meta_value_num THEN by title
- How to query_posts using meta_query to orderby meta_key AND have a secondary sort by date?
- meta_query sorting by 2 keys
- Get result from meta_query() between two numbers
- How to handle optional end date in compare clause in meta_query
- Using meta_query on pre_get_posts to exclude a particular meta_key value
- How to return results of a get_posts() in explicitly defined order
- Query between two meta keys
- How do you get posts by meta_query using the JSON API plugin?
- Archives for custom post type based on a “date” meta value
- Query all posts where meta value is empty
- How to check a single number value against an array of meta_key values?
- get_users meta_query
- Meta query with multiple logic (AND / OR)
- Best practice – Meta Query vs. post_clauses for “left join” ordering
- meta_query with multiple values
- Meta Query with date and time on the same Day before given time
- Different page parameters inside query
- Return posts with specific meta key first, but the rest in alpha order by last name
- meta_query key value from array
- LIKE %…% Meta Query
- Multiple Values stored as array in Meta Query
- Order by nested named meta queries with ‘exists’ and ‘not exists’
- Documentation for post meta
- Arrange Posts By Date In Order Of Closest To The Current Date
- Using get_terms() with meta_query parameters
- WP_User_Query with meta_query array relation ‘OR’
- Loop through two different sets of custom fields
- Possible to create a permalink to sort with meta_key?
- meta_query problem
- Custom Upcoming Events List for Events Manager Plugin
- Very slow query with meta_query on large database
- How to use meta_query to check if a meta field has something set?
- meta_query date and time comparisons
- Using database meta_values to calculate new post order using pre_get_posts or a ‘request’ hook
- How to exlude posts that have certain meta_value?
- Sortable admin column for one meta key with three possible meta values
- User Relationship
- Sorting posts by multiple values, combined
- meta_query results not the same with and without spaces
- Meta query with order by another custom field
- meta_query all posts between to ages
- How to make a WP REST API query with meta_query in WP4.7?
- wordpress custom_meta ordering of timestamps
- WordPress Core – Optimizing meta_query generated SQL?
- Sort Posts by Multiple Meta Values [duplicate]
- Edit post_content on posts with Featured Image
- Nested Queries using meta_query
- Display no post when metavalue is 0
- Use both meta query and tax query
- Wildcard with LIKE operator in Meta query
- How to orderby meta_value_num with dollar ($) sign
- meta_query, number comparison, not quite working as it should
- Meta Query Compare with Date
- Query posts only if meta_value is not empty
- Does meta_query working with value paramater higher then 999?
- meta_query keys and sticky posts
- How to pass user meta_key and meta_value (values as array)
- WP_Query ordered by meta_value_num doesn’t fetch posts without this meta field
- Query Multiple values for same key
- Custom post type archive with rand and meta_value
- Comparing a field with several values at once with meta_query
- Meta query with a sub query group possible?
- meta_query compare=’!=’ with multiple custom fields
- Query posts with numeric meta values within a given range
- Meta query: get posts with value in a multidimensional array
- Sort posts by most recently modified
- Fastest way to do meta query when I don’t need the actual posts, and just need post_id?
- meta_query not working on live site
- How to query post only with different excerpt?
- How do you get Posts by multiple meta_keys and meta_values with the Rest API V2?
- Query custom field with date
- Stuck in Order by more then one
- Meta query with regular expression does not work
- Searching in title or meta, with a tax query too!
- WP_Query with meta_query no results
- Documentation for post meta
- Help ordering Post loop by two meta values
- Get posts with multiple meta values
- Meta Query returns wrong number of posts
- WP User Query Issues
- How to use meta query for greater than value in array?
- Wp Query custom search by meta query
- Pre Get Posts / Multiple Meta Keys / Orderby Single Key
- Filter posts by meta query?
- Help on multiple meta_query
- Meta query – How to display a null meta key
- pre_get_posts and set
- WordPress Screwing Up ‘orderby’ => ‘meta_value_num’ in ‘pre_get_posts’
- How to query wp_postmeta table for any specific meta_value?