• i am successfully sorting posts by custom field “year” using

    query_posts($query_string . '&meta_key=Year&orderby=meta_value_num');

    however this omits any posts where i might have forgotten to add that custom field. how do i have those posts simply show up at the bottom of the sort?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Your query is specifically omitting those posts at your request.

    The cleanest solution would be to add the custom fields so they’re included properly. This way pagination and other goodies wouldn’t be affected.

    The alternative is to do a second loop to query for recent posts, while excluding any posts which were found in the first loop.

    Thread Starter ericjforman

    (@ericjforman)

    thanks for the reply. yes, it’s definitely better to make sure the field is added to every post. do you know of a way to highlight in some fashion those posts that are missing that field? otherwise i have to click on every post and edit it and look for the field.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘query_posts sorting by custom field leaving out those missing that field’ is closed to new replies.