WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
<?php query_posts( 'cat=16'); ?>
        <?php if ( have_posts() ) 
        while ( have_posts() ) : the_post(); ?>     

                      <?php print_custom_field('time'); ?>
                       <?php the_title(); ?>

<?php endwhile;?>

this is my query I want the post is order by custom field 'time' in ASC

share|improve this question

That would be something like:

query_posts( array(
                  'cat' => '16',
                  'order' => 'ASC',
                  'orderby' => 'meta_value',
                  'meta_key' => 'time',
             ) );

See WP_Query documentation in Codex for more information.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.