WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Could you show some code, what you've tried so far? – Lea Cohen Feb 3 '13 at 7:02

Use WP_query

and read this article too:


share|improve this answer
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 Feb 4 '13 at 21:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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