WordPress.org

Ready to get started?Download WordPress

Forums

Order by Custom Date - Breaking Category (2 posts)

  1. adambeaumont1
    Member
    Posted 2 years ago #

    i am struggling to display events based on custom field 'eventdate' as I cannot even get the website to display the posts that are in the right category. For example I am trying to order all by date except some blog posts which don't have a custom field.

    So all categories are broke whenever I try to use either WP_Query or query_posts, simply displays all posts. Can somebody help. FREE Link (do follow) for getting me the right answer.

    `//wp_reset_query();

    //$loop = new WP_Query( array( 'meta_key' => 'eventdate', 'order_by' => 'meta_value', 'order' => 'DESC' ) );

    //$custom_query = new WP_Query('order=ASC');

    //query_posts('category_name=');

    //query_posts('posts_per_page=6');

    //query_posts('cat=-21');

    // $args = array(
    // 'meta_key' => 'eventdate',
    // 'orderby' => 'meta_value',
    // 'order' => 'DESC',
    // 'meta_compare' => '<=',
    // 'meta_value' => date_i18n('Y-m-d'),
    // 'caller_get_posts' => 1,
    // );
    //query_posts($args);

    //$loop = new WP_Query( array( 'posts_per_page' => 999, 'meta_key'=>'eventdate', 'orderby' => 'meta_value', 'order' => DESC ) ); while ( $loop->have_posts() ) : $loop->the_post();

    if(have_posts()){ while (have_posts()) : the_post();
    if(!pagelines_show_clip($count, $paged) || is_admin()):

    '

  2. adambeaumont1
    Member
    Posted 2 years ago #

    The above shows all the attempts I have made.

Topic Closed

This topic has been closed to new replies.

About this Topic