• <?php
    query_posts( array( 'post_type' => 'television', order_by => 'meta_value&meta_key=date', order => 'desc') );
     if ( have_posts() ) : while ( have_posts() ) : the_post();
    ?>

    Pretty straight forward – however it’s not working.

    Once the sorting issue is covered, I would like to display only the month and year of the post.

    Any pointers would be greatly appreciated! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    If I understand you correctly, just replace the_post(); with echo get_the_date('F Y');

    Thread Starter sdaponte

    (@sdaponte)

    Sorry, I should have been more clear.
    I’m using custom post types, and by extension using a custom date field.
    I don’t want to display the date that the post was created, but the custom date that the field specifies, since the client is backlogging pre-existing articles.

    Thanks for your response and thanks in advance to anyone else who can offer help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sort by custom date field’ is closed to new replies.