I have 3 columns in my category page. On the left column, I want to show Recent posts only from that category I am viewing. In the middle column I want to show most viewed post only from that category and in the extreme right column I want o show all featured post.

I am unable to accomplish that, so needing help.

  • Could you show some code, what you've tried so far?
    – Lea Cohen
    Commented Feb 3, 2013 at 7:02

1 Answer 1


Use WP_query

and read this article too:


  • I know how to show popular posts..and my question was not about how to show the popular posts but how to shows post from the category you are viewing. Anyway I hv fixed it by tweaking my query...The following code did the trick: '<?php global $post; ?> <?php $categories = get_the_category(); foreach ($categories as $category) :?> <?php $args = array( 'numberposts' => 20, 'category' => $category->term_id ); ?> <?php $myposts = get_posts( $args ); ?> <?php foreach( $myposts as $post ) : setup_postdata($post); ?> '
    – Ajay M
    Commented Feb 4, 2013 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.