Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $current_cat = get_query_var('cat');
- // for tags use 'tag'
- // $current_tag = get_query_var('tag');
- $args = array(
- 'cat' => $current_cat,
- // 'tag' => $current_tag,
- 'post_type' => 'post',
- 'posts_per_page' => 1
- );
- $the_first_query = new WP_Query( $args );
- // The Loop
- while ( $the_first_query->have_posts() ) : $the_first_query->the_post();
- the_title();
- endwhile;
- // Reset Post Data
- wp_reset_postdata();
- $args = array(
- 'cat' => $current_cat,
- // 'tag' => $current_tag,
- 'post_type' => 'book',
- 'posts_per_page' => 1
- );
- $the_second_query = new WP_Query( $args );
- // The Loop
- while ( $the_second_query->have_posts() ) : $the_second_query->the_post();
- the_title();
- endwhile;
- // Reset Post Data
- wp_reset_postdata();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement