• I’m trying to get a post query array via category tags. There’s two categories “news” and “events” under “News & Events”, but the catch is that I want to sort by “events” first, then the “news” behind, and then take the first four to display on the site.

    <?php
    query_posts( array( 'post_type' => 'news-events', 'publish' => get_query_var('paged'),  'orderby' => 'date', 'order' => 'DESC', 'showposts' => 4 ) );
    while ( have_posts() ) : the_post();
    $prod_id=$post->ID;
    $feat_image = wp_get_attachment_url( get_post_thumbnail_id($prod_id) );
    ?>

    This is what I currently have now. How do I arrange by “events”, then “news”? I’m pretty new to this.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Arrange Post Query by category’ is closed to new replies.