You can use meta_query
to get only posts with display_submenuexpositions = true
and order them by order_submenuexpositions
.
$args = array(
'orderby' => 'meta_value',
'meta_key' => 'order_submenuexpositions',
'meta_query' => array(
array(
'key' => 'display_submenuexpositions',
'value' => 'true',
'compare' => 'LIKE'
)
)
);
$query_posts( $args );
Related Posts:
- Order by value in serialized custom field
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- Meta Query And/Or
- Display agents (custom post type) alphabetically, except one who always shows last
- WP_Query – Order results by meta value
- Custom query with orderby meta_value of custom field
- SQL Query to copy value of a meta_key into another meta_key
- How to correctly call custom field dates into a posts_where filter using SQL statements
- Can I query custom meta data through WP_Query
- How to rename a custom field?
- Using OR conditions in meta_query for query_posts argument
- query_posts and only show results if a custom field is not empty
- Display Custom Post Type Fields
- How do I order by multiple custom fields using wp_query?
- Trying to perform complex custom field query with order by set to field value
- Query meta field using between
- Order Posts by Closest Numeric Values
- Order posts by custom field and if custom field is empty return remaining posts
- Bulk move (or copy) from a custom field to the post content?
- Can serialized arrays in DB be matched against serialized arrays with meta_query?
- Up/Down voting system for WordPress
- Custom Fields Bulk Edit
- WP_Query multiple use of relation and/or
- Query Problem – Show posts within category ‘x’ that have a custom field between ‘y’ and ‘z’
- Using OR in WP_Query negates the “NOT EXISTS” compare
- How to use query_posts() with a date filter on a custom field?
- How to filter a dd/mm/yyyy date from a custom field in a query
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- Using WP Query to search by multiple meta fields
- Difference between ‘LIKE’ and ‘IN’ in meta queries
- How add a custom posttype name using ACF field to a query post array
- Compare WP Custom Field date
- Sort by posts that have a featured image?
- WP_Query display next custom post from today’s date
- Can ordering post list by meta_value cause performance issue?
- $wp_query meta_key naming issue [closed]
- How do I query for a post by custom field?
- Meta_query and numeric comparison [closed]
- Adding Custom Fields to Search
- Any way to include custom fields in WP_Query results?
- how can i use custom field in query post
- using multiple meta_key and meta_value in query_posts
- Get all posts that do not have a specific custom field without using a subquery
- Query post order by post and desc not working
- Multiple relationships in a query
- How can I sort homepage by a meta value?
- WP Query Returning All Posts
- Meta query with timestamp using WP_query
- Custom Field Create Bulk via SQL Query
- Auto Populate Custom Field with Complex Value That Increase by One?
- How to select posts from multiple categories and metavalues?
- meta_compare seems to be treating values as strings instead of integers as expected
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- Including metaboxes from custom post types in global search — continued
- how to make members list directory through wordpress post custom meta key.
- UPDATE on SELECT results. A SQL query to swap Author with Meta Box value
- Query all posts if multiple meta key don’t exist
- Query Posts by Custom Field
- query posts custom field calculation value
- WP Query – Is this correct?
- Query_posts with custom field meta value
- Passing meta_box string to post__in?
- Unable to get specific value from post meta
- Order post type by sum of two custom fields
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- meta_value and meta_key filtering returning no posts [closed]
- Can’t query by meta_key
- Adding custom field and querying from post table
- Conditional operator OR not working with custom fields
- Posts query according to meta box date
- Meta_query ‘compare’ => ‘LIKE’ not working?
- Get emails from users by custom field SQL
- query_posts with meta_value
- Custom search SQL Query to add custom field in result
- How to put forward a blog post
- Meta query relation ‘OR’ not working as expected
- The best way to collision check in WP
- SQL: Select wordpress posts with given text string and add a custom field to them?
- How can I change the publish date based on a custom field?
- WP_query multiple custom fields not working
- Show array of meta_value in Edit Post Coloum
- Custom Query Fields – Altering Meta Value
- Multiple Custom Field Query
- Get author total post votes from post meta
- simple fields plugin custom query
- WP query_posts group by meta field related
- Problem with my loops
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- SQL query to change the value of a Custom Field
- How to search CPTs in draft using get_page_by_title()
- query_posts -> get page_id from custom field
- Custom WP_query and integrating into theme file
- query_posts with sorting on a custom datestamp
- query post based on comparison
- How to Order Posts by Custom Fields?
- query specific posts according their custom fields, using sql SELECT
- Complex WP_Query Using Post Date And Post Meta
- Show posts containing or not custom field
- Filtering posts by WORD in custom field
- Display ACF object field data using Elementor Custom Query