You can define custom where
like this if your table is wp_posts
function _20170112( $where ){
$where = $where . ' AND wp_posts.menu_order > 0 ';
return $where;
}
And sandwich your query with this:
$args = array(
'post_type' => 'page',
'post_status' => 'publish',
'meta_key' => 'tile-home',
'meta_value' => 1,
'orderby' => 'menu_order',
'order' => 'ASC'
);
add_filter( 'posts_where', '_20170112' );
$q = new WP_Query($args);
remove_filter( 'posts_where', '_20170112' );
Related Posts:
- Exclude post ID from wp_query
- How do I order pages and categories by ID or name in the same query?
- How to filter by category in REST API, excluding posts also in other category term?
- Get attached media only
- WordPress altering my custom query, How to fix it?
- If orderby parameter using pre_get_posts is the same for multiple posts what fallback does the query use?
- Query Ignoring ‘exclude’ Parameter?
- Change default ordering of taxonomy terms – pre_get_terms
- Query: offset post list, unless it’s a specific category
- How to set multiple `orderby` in query argument?
- Why isn’t my multiple orderby working?
- Woocommerce – Changing the order of the upsell products [closed]
- Excluding pages in WP_query using ACF
- Exclude Category filter from Portfolio section
- Avoid repeated post on page 2 when excluding one on page 1
- 2 wordpress loops showing 1 post from same post type – how to avoid showing the same post?
- Include posts from some categories while excluding from others
- Exclude current post from an array of posts?
- Exclude recently updated post from custom WP_Query using multiple loops
- How to exclude Sticky from Recent Post?
- specific post is not excluded from the loop
- Paginate wp_query while utilizing post__not_in
- WP Query Obj: Set value to be unequal | Hide media by admin
- Can I use WP_Query to find a post with a particular menu_order?
- WP_Comment_Query pagination, delving into the unknown
- Sort posts by category name and title
- Getting all user metadata from user
- ajax category filter
- Display posts the match taxonomy term linked from wp_list_categoies?
- Limit WP_Query to only X results (total, not per page)
- How to disable main query?
- Use post__in and post__not_in together?
- WP_Query on different site in a multisite setup
- How to user WP_Query to lower the number of queries
- Compile two queries to one set of results?
- how do i combine keyword search and taxonomy in a WP_query $args array Worpresss [closed]
- Sanitizing search data for use with WP_Query
- How to search by a post and a category name on wordpress at the same time?
- What’s the point of the query_vars filter?
- How to retrieve current page WP_Query arguments?
- How can I get an array of all IDs from the current queried object?
- Get Category Archive Template Name Dynamically
- How to limit WP_Query to one result on the loop?
- Query post from all category with same tag on 1 pages
- How to correctly pass values to wpdb->prepare()?
- Wp redirect to url with ampersand string
- Get attachment by meta_key value
- Complex WP_Query order request: DESC by day, but then ASC by time
- How to detect if query is runned from widget?
- Change query based on post type while staying in loop
- Sort wordpress custom posts based on meta value
- Custom Pagination Layout for Elementor widget
- $WP_Query: How to display excerpt on first post only
- How to properly reset a nested WP_Query query
- How to make search for posts using get method?
- Is there a reason why Pages are not publicly_queryable?
- How Can I Change The Tax Query For The Main Loop For Taxonomy Archives?
- Exclude some authors from query
- apply custom where to the default $wp_query
- wp_query serialised array
- Conditional operator OR not working with custom fields
- How to add custom meta to ‘pre_get_terms’?
- Using Transients
- Should I reset $wp_query?
- how to write wordpress query for multiple metakeys checking?
- Sorting search results with custom dropdown
- Posts query according to meta box date
- querying posts with a custom status
- problem with loop
- Display post meta conditionally based on it’s value
- Randomly select one of last 3 posts
- Query multiple meta key values for template
- How do I get the content of a custom instance of WP_Query?
- Change post query onclick
- Display upcoming events in the next 30 days by querying posts with timestamp in custom meta
- Searching not only by post name but also category
- WP_Query, Paginate by Custom Field
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- is_user_logged_in not working from WP-API (wp-json)
- WordPress private post won’t display to other admins
- Only show tag with the same id as the post
- Search Exact on WordPress – Relevannsi Solution Not Working
- Posts per Page not working
- Show a message if there are no active posts in category
- Get authors list and sort them by recent posts
- Custom filter from post meta
- Pagination not working in custom loop WP_Query
- Multiple wpostmeta.meta_key
- Saving custom fields for WP_Query to retrieve
- Modify query to exclude certain ids and certain parents and its corresponding children
- I need value of saved meta to display next to the post it is associated with
- Post Query not working after updating to 4.1
- Cannot order by in WP_Query
- new WP_Query based on average values of meta fields
- Can’t seem to get an else statement correct? [closed]
- query_vars category_name only display one catgory out of multiple categories
- Incorrect posts displayed on category page
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
- new WP_Query with order args – no more distinction between categories
- How to make OR condition in WP_Query