• Resolved brody_zen

    (@brody_zen)


    specific categories on specific pages.

    My site displays specific categories on specific pages.

    I achieved this by using the following code

    <?php
    if (have_posts()) {
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("category_name=Blog&paged=$paged");
    }
    ?>

    provided by Kafkaesqui

    My onlt issue is that it is only displaying the last entry.

    how can i make it show a specific number of post?
    and why does it remove my page title and replace it with the title of the first post?

Viewing 2 replies - 1 through 2 (of 2 total)
  • 1) You have the query_posts in the wrong place – it goes before the “if have posts”
    2) you are missing the “while” loop – it is only processing one post, thus you are seeing one post

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("category_name=Blog&paged=$paged");
    <?php if (have_posts()) : ?>
        <?php while (have_posts()) : the_post(); ?>
                      --- stuff   ---
    <?php endwhile; ?>
                      --- optional stuff   ---
    <?php else : ?>
                      --- optional stuff   ---
    <?php endif; ?>

    Make these changes & see if your title is still incorrect. If yes, post back

    Thread Starter brody_zen

    (@brody_zen)

    works great thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘specific categories on specific pages.’ is closed to new replies.