Well, you can’t sort by field that isn’t there. You can modify query conditionally only in those categories which have that field and let default query work in rest.
It would be something like:
if( is_category('abs') )
query_posts(
array_merge(
array('orderby' => 'meta_value',
'meta_key' => 'field_order',
'order' => 'Desc' ),
$wp_query->query
)
);
Related Posts:
- Order by meta value or date?
- Filtering posts by post meta data
- How to sort by meta value?
- get_post_meta causes database queries
- Querying posts with meta value that begins with a certain pattern
- IF.. post meta show… Conditional Tag Help…?
- order posts by meta value on posts page
- Query_post($args)
- 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
- Exclude posts by post meta value
- Frontend form with multiple posts
- query_posts orderby postmeta [closed]
- Ordering Posts By Meta Data
- get all posts with certain meta data
- Limiting the amount of posts this displays
- what is the correct way to compare dates in a WP query_posts meta_query
- query_post by title?
- How to query_posts using meta_query to orderby meta_key AND have a secondary sort by date?
- Help to condense/optimize some working code
- query_posts exclude a meta key
- Modify main WordPress loop with a parse_query filter
- How to make “sticky” pages (and query by them)
- Problem with ‘post__not_in’
- Sort posts alphabetically by custom field value, insert divider between different letters
- using post__in allow duplicate post id
- Use union/intersection query_posts variables in uri request parameter form?
- query_posts doesn’t order by title
- How to ensure that is_search() return false after query_posts
- Inserting Post Using wp_insert_post. How to Fill Yoast Plugin SEO Fields
- Post count per (day/month/year) since blog began
- Dynamically excluding current page id
- How do i paginate query_posts with numeric pagination?
- Query 1 taxonomy term, exclude another
- Pagination on custom query
- Ordering terms before displaying posts
- Sort Posts by Multiple Meta Values [duplicate]
- Adding Variables to post query
- Static Front-Page Excerpts
- How to reverse the order of WordPress blog posts?
- Tricky WP Query
- tax_query operator woes
- query_posts() ALWAYS displays something?
- Trouble with get_next_post() get_previous_post() returning null
- How can i display the posts per week in a particular month?
- Display custom post type from dynamic custom field
- Possible to display posts containing a short code ?
- How to run a SQL Query for character in Post Titles
- Authors List page : how to exclude posts from certain category
- Using ajax with paging and a custom sub-query
- Fetch Record based on meta key dates
- ACF Query meta_values don’t work with ‘offset’
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- define orderby URL with meta_key=post_views_count
- Query_posts and attachments
- Custom loops, sticky posts, and pagination nightmare
- Querying posts only if the current page is not paged?
- Filter date from post meta when date is in string format
- post_parent array doesn’t work
- how to store wordpress loop in array?
- meta_query check for meta value in key which holds an array of values
- How to place an image after Nth number of posts in query_posts
- Related Posts: Notice: Undefined offset: 0
- Single-page wordpress theme navigation
- meta tag placement for google verification
- When to use WordPress loop or Foreach loop?
- Can’t get pagination to work for sticky posts only
- show x number of posts from y category on homepage
- How to Show Comment Count on Related Posts?
- Way to cache a query for 24 hrs
- Make query_post category name dynamic
- How can I list posts with different formats depending on order?
- WordPress Query based on random taxonomy
- Displaying and Querying Posts with Featured image
- View Achive with Category Filter, but Page per post not working
- 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
- grab neighboring content in a query
- Querying a query
- How do I query based on the modified date?
- Is there any way of only retrieving posts with one or more thumbs up (GD star rating plugin)?
- How to put orderby on a custom field in query_posts
- Remove post from latest posts after a month only with certain tag
- update a posts of other custom post type
- Filter posts by current date ( WP Post Carousel )
- Ordering posts alphabetically by meta keys and title
- Sort Posts By Custom Field Date
- wp_query by last month + sort posts
- How to query post ids liked by the Author
- query_posts not working after wordpress 3.7 update
- Post Filter clearing on pagination $_post
- 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
- Multiple loops with / without sticky posts and different post limits
- prevent display duplicate titles on main page
- Lots of SQL queries