• bengreen1980

    (@bengreen1980)


    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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    How many posts per page have you configured in Admin/Settings/Reading?

    Thread Starter bengreen1980

    (@bengreen1980)

    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).

    esmi

    (@esmi)

    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.

    Thread Starter bengreen1980

    (@bengreen1980)

    Is there a way I can do this outside the lop?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘A simple thing?’ is closed to new replies.