Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created January 10, 2013 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whyisjake/4504796 to your computer and use it in GitHub Desktop.
Save whyisjake/4504796 to your computer and use it in GitHub Desktop.
When you add an orderby with the meta_key set to the page number, if no value is set, the results are omitted, is there any way around that?
<?php
$args = array(
'post_type' => 'magazine',
'title' => 'Articles',
'post_parent' => $post->ID,
'order' => 'asc',
'meta_key' => 'PageNumber',
'orderby' => 'meta_value_num'
);
make_magazine_toc($args);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment