$args = array(
'meta_key' => 'home_post_id',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'meta_query' => array(
array(
'key' => 'home_post_id',
'value' => 0,
'compare' => '>',
'type' => 'numeric',
)
)
);
query_posts($args);
Something like this should work but I haven’t tested it .)
Let me know if it works..
Reference: WP_Query – Custom Field Parameters
Related Posts:
- Order by meta value or date?
- Filtering posts by post meta data
- Query Custom Meta Value with Increment
- Problem with ‘post__not_in’
- Sort X categories by last update and show image
- using post__in allow duplicate post id
- Using dynamic conditions in ‘posts_where’ filter
- How to limit search to first letter of title?
- Custom query with query_posts doesn’t show post without certain meta_key
- Counter code for paginated category pages in wordpress
- WordPress Search Filter Only for Page with Child of Child of Child of Child of Child
- How to sort by meta value?
- pagination in author.php template returns 404 error
- get_post_meta causes database queries
- How to display liked posts of current user in wordpress?
- How to modify the query to exclude posts by slug?
- Dynamically excluding current page id
- Querying posts with meta value that begins with a certain pattern
- Adding Variables to post query
- How can I sort homepage by a meta value?
- Tricky WP Query
- IF.. post meta show… Conditional Tag Help…?
- query_posts() ALWAYS displays something?
- order posts by meta value on posts page
- Query_post($args)
- Using ajax with paging and a custom sub-query
- query_posts() on key’s value, or key’s existence
- How to retrieve an array of post IDs by a particular value stored in a custom meta’s array
- Query posts by meta_key whose value is an array
- Each post is showing twice in my custom query…?
- Frontend form with multiple posts
- How exclude 3 latest posts of a category in query_posts
- query_posts orderby postmeta [closed]
- Can I use WP_Query one time and then filter the results multiple times
- Different layout based on post amount?
- How to solve this without flushing the rewrite rules for each post query the visitor triggers?
- How to check a list or feed of all posts under a category and tag?
- Best Query for blog posts
- I need query_posts() to order results first by a meta value and then by post ID
- Ordering Posts By Meta Data
- Ordering posts alphabetically by meta keys and title
- How to query post ids liked by the Author
- Adding Category Argument into an Array for WordPress Query
- get all posts with certain meta data
- Limiting the amount of posts this displays
- query_post by title?
- Modify main WordPress loop with a parse_query filter
- Search custom post type by meta data
- query recent posts from several categories
- Example Query Posts Showing the Latest Post with the Featured Image
- Automatically adding meta data to posts or multiple query help
- How to Loop within a Loop (Display Children and then Grandchildren)
- Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
- How to order results by date and meta key?
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- posts_per_page => 1 shows 2 posts
- Query post with meta_query where date is not in future
- Show individual author rank from query of cumulative post view count for all authors
- Custom posts per page does not work with pagination
- posts_per_page override by default settings
- How to paginate posts correctly that belong to a particular category and are random ordered
- How to filter query to display posts from parent category only?
- Display random post on a page with post permalink in URL
- Query Posts Exclude Entire Category
- WordPress pagination with get_posts?
- Slow page loads due to WordPress Core Query
- How to display certain category in the loop from WordPress default post type?
- How to display posts by vote count and if no value continue with latest posts with no votes?
- posts_per_page option limits the number of Gallery items
- Filter Loop by Custom Field Value
- Display custom post type by custom taxonomy
- WordPress wp_get_attachment_thumb_url full
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Single-page wordpress theme navigation
- meta tag placement for google verification
- Returning a custom content types with meta values
- Way to cache a query for 24 hrs
- Declaring a var, placing it in a query and using the output of the query?
- Custom Post type showing up in loop, regular posts are not showing up
- Combining two meta_values within one row with query
- Meta query stopped working
- Sticky posts don’t show up first in custom loop
- Want Page Descendants when using query_posts post_parent or child_of
- Querying a query
- How do I query based on the modified date?
- How to fetch courses in all languages in WordPress?
- searching by keywords in post’s metas or pagination links problem
- Show 5 posts and than 3 posts offset with pagination
- Merge two queries and remove duplicate
- update a posts of other custom post type
- $query->set( ‘post_type’, ‘post’ ); not working
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- query_posts not working after wordpress 3.7 update
- Is that the query_posts() the real criminal here?
- Query specific posts from parent by slug rather ID
- query_posts and sub pages?
- How to refine WP-Query with further criteria
- prevent display duplicate titles on main page
- Lots of SQL queries
- Sort Posts Alphabetically Based on Specific Category (Divi)