Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="top-posts">
- <?php
- if (have_posts()) :
- while(have_posts()) : the_post();?>
- <div class="content">
- <?php the_post_thumbnail('archive'); ?>
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
- </div>
- <?php endwhile;?>
- <?php endif;?>
- </div>
- <div class="primary-posts">
- <?php
- if (have_posts()) :
- while(have_posts()) : the_post();?>
- <h2><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h2>
- <?php endwhile;?>
- <?php endif;?>
- </div>
- $cat_id = $wp_query->get_queried_object_id()
- $args = array (
- 'cat' => $cat_id,
- 'posts_per_page' => 2,
- )
- $the_query = new WP_Query ($args);
- if ($the_query->have_posts()) {
- while ( $the_query->have_posts() ) {
- $the_query->the_post();
- // display stuff
- }
- wp_reset_postdata(); // restore the original archive loop
- }
- <?php
- rewind_posts();
- if (have_posts()) :
- while(have_posts()) : the_post();?>
- <h2><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h2>
- <?php endwhile;?>
- <?php endif;?>
Add Comment
Please, Sign In to add comment