Forums
Forums / Fixing WordPress / A simple thing?
(@bengreen1980)
16 years ago
Dear members,
I am new to WordPress, but learning very quickly! I have a very simple requirement:
On my custom category template (category.php), I would like to show a list of the 10 must recent posts for the current viewed category? Am I asking the impossible?
(@esmi)
How many posts per page have you configured in Admin/Settings/Reading?
1 – I only want 1 post on the page.
Then I would like a click-able list of other post in that category (just titles and dates).
Something like:
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args= array( 'posts_per_page' => 10, 'paged' => $paged ); query_posts($args); ?>
just above the start of the Loop should display 10 posts per page.
http://codex.ww.wp.xz.cn/Function_Reference/query_posts
After that, it’s down to customising the code within the Loop if you want a different display for the first post on the page compared to the other 9.
Is there a way I can do this outside the lop?
The topic ‘A simple thing?’ is closed to new replies.