Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php query_posts(‘cat=xx); ?>
    xx will be the category ID
    You can also use the category name or slug like this:

    `<?php query_posts(‘category=category-slug-name’); ?>’

    You can also use this to limit the number of posts on your homepage to be different from the number of posts shown on other pages as set in your blog Settings>Reading>blog pages show at most number of posts……

    <?php query_posts(‘cat=8&showposts=4’); ?>

    Thread Starter nikola_666

    (@nikola_666)

    so I need to replace this <?php if (is_category()) { ?> with <?php query_posts('category=category-slug-name'); ?> or ?

    Please if you can edit the whole code above ..

    that should work

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

The topic ‘help with recent post from specific category PHP code’ is closed to new replies.