0

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 Feb 3 '13 at 7:02
0

Use WP_query

and read this article too:

http://www.wpbeginner.com/wp-tutorials/how-to-track-popular-posts-by-views-in-wordpress-without-a-plugin/

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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