post
is not a valid value for orderby
parameter neither DESC
. You can choose any of these values. Also, you should stop using query_post
.
<?php
$args = array(
'post_type' => 'ranking',
'orderby' => 'menu_order',
'order' => 'DESC',
'posts_per_page' => 10,
'meta_key' => 'top10',
'meta_value' => 'sim'
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) {
$loop->the_post();
//Do whatever you want with the posts
}
//After the loop reset post data
wp_reset_postdata();
?>
Related Posts:
- query_posts with meta_value
- Custom query with orderby meta_value of custom field
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Max length of meta_value
- Query Posts or Get Posts by custom fields, possible?
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?
- query_posts and only show results if a custom field is not empty
- Filter archive.php by custom meta
- get_pages sort alphabetically by meta value
- Assign/update the custom field value for all posts
- Order posts by custom field and if custom field is empty return remaining posts
- Order by custom field date with ASC order
- Query on custom field count?
- How to break meta values into different items and avoid duplicates?
- How to use query_posts() with a date filter on a custom field?
- WP_query : meta_key with custom rule for specific value
- meta_value_num sort glitch
- Can ordering post list by meta_value cause performance issue?
- Order by value in serialized custom field
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- How do I query for a post by custom field?
- meta query not showing any results?
- How to sort category by custom field value
- trim custom field text value and show (…)
- how can i use custom field in query post
- using multiple meta_key and meta_value in query_posts
- How can I sort homepage by a meta value?
- Order query by meta_value with multiple custom fields
- How to wrap meta values seperated by comma in ? [closed]
- How to create a Custom Meta Box with Name/Value Admin User Input Fields?
- Show 1 post and after a specific date show the next one
- Run a check for multiple meta key values
- Filter by custom field (meta_key) using JSON API
- How to select posts from multiple categories and metavalues?
- meta_compare seems to be treating values as strings instead of integers as expected
- Removing link ” from ” on meta_value in custom feilds
- Sort alphabetically by custom field
- Change order of posts
- filter custom field values $min $max
- query posts custom field calculation value
- WP Query – Is this correct?
- Query_posts with custom field meta value
- Unable to get specific value from post meta
- pre_get_posts : only get posts by wp_usermeta value
- meta_value and meta_key filtering returning no posts [closed]
- IF Custom field value equals ZERO
- List custom field values in alphabetical order without repetition
- How to update a custom field in all posts with the value of another custom field in the same post?
- Update post meta custom field using block editor
- How to add custom filed value after in wp post title
- Sortable Custom Columns not sorting correct
- Meta_query ‘compare’ => ‘LIKE’ not working?
- Custom search SQL Query to add custom field in result
- How to put forward a blog post
- How can I change the publish date based on a custom field?
- Show array of meta_value in Edit Post Coloum
- Get author total post votes from post meta
- Problem with writting correctly a query posts args in WordPress
- simple fields plugin custom query
- Making WP_Query limit results by date before today where date is a meta_query
- User query – getting values for custom meta keys/fields
- get posts based on non-single metadata
- Set class if a meta value is set within post archive
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Create Shortcode shows only posts with custom_field meta
- query_posts -> get page_id from custom field
- 4 Unique Random Posts based on Custom Field Values
- Custom Field: Display only if a specific key is selected outside the loop
- Checking if field is set before comparing with meta_query in query_posts?
- Filtering posts by WORD in custom field
- Display agents (custom post type) alphabetically, except one who always shows last
- Filter Query Post by Custom Fields(by date)
- WP Query Args – search by meta_key or title
- Saving multiple custom meta box fields
- get Custom field label (select/dropdown) on front end
- What is the index [0] for on post meta fields?
- Using meta_query, how can i filter by a custom field and order by another one?
- Add custom fields when specific templates are selected
- Using media-upload.php to upload mp3 via custom fields
- Meta keywords and descriptions plugin for manually editing meta for each page/post
- How to add/save Custom Field in user settings/profile “Checkbox list”
- Display info from custom fields in all images’ HTML
- Login & Register & Custom details WITHOUT plugin
- Ordering posts by date custom field
- ACF: How to get the full field name (meta_key) by a field key?
- modify wordpress caption shortcode
- Custom meta boxes in RSS feed
- Ordering by ‘Title’ OR ‘Custom Field’
- How can I add/update post meta in a admin menu page?
- pull all posts’ meta key values from current category only
- Add WordPress user custom meta to chartjs vertically stacked chart in Divi theme
- Shortcode for Custom Field of Media Attachment (to use with Featured Images)
- submitting form to admin-panel.php returns 500 error
- Outputting custom field on home.php not outside of blog list
- How to delete attachments associated with custom field type when post property changes? [closed]
- custom field images do not display until page save
- Custom Field select list is truncated
- Query Posts Via WordPress URL
- Semi-Private Comments + page comments -> is it possible?