• I have a custom template page displaying as the first page. On this page I’m showing posts from the ‘whatsnew’ category. However, when I click on the “older entries” button at the page navigation links, it automatically takes me to the “all posts” page, which is the blog page.
    How can I specify the navigation links to stay in the ‘whatsnew’ category?
    I have several pages that show specific categories and they all behave this way when directed to display as front page.

    See code below:

    <?php
    /*
    Template Name: whatsnew
    */

    get_header(); ?>
    <div id=”content” class=”narrowcolumn”>
    <div id=”custompageheader”>
    <h1 class=”custompageheader”>
    <?php the_title(); ?>
    </h1>

    </div>
    <?php
    $temp=$wp_query;
    $wp_query=null;
    $wp_query = new WP_Query();
    $wp_query->query(‘showposts=5’ . ‘&cat=6’ . ‘&paged=’.$paged);

    ?>
    <?php if( $wp_query->have_posts() ) : ?>
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    <?php
    //necessary to show the tags
    global $wp_query;
    $wp_query->in_the_loop = true;
    ?>
    <div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>
    <?php if ( function_exists( ‘get_the_image’ ) ) { get_the_image(); } ?>
    <h2>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”>
    <?php the_title(); ?>
    </h2>
    <div class=”entry”>
    <?php the_excerpt(); ?>

    ” title=”Read More”>Read More… </div>
    <div id=”custompagepost”>
    <div class=”custompagedate”>
    <?php the_time(‘F jS, Y’) ?>
    <!– by <?php the_author() ?> –>
    </div>
    <!–<?php the_tags(‘Tags: ‘, ‘, ‘, ‘
    ‘); ?>–>
    <div class=”comments a”>
    <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?>
    <?php comments_popup_link(‘No Comments ?’, ‘1 Comment ?’, ‘% Comments ?’); ?>
    </div>
    </div>
    </div>
    <?php endwhile; ?>
    <div class=”navigation”>
    <div class=”alignleft”><?php next_posts_link(‘« Older Entries’) ?></div>
    <div class=”alignright”><?php previous_posts_link(‘Newer Entries »’) ?></div>
    </div>
    <?php $wp_query = null; $wp_query = $temp;?>
    <?php else : ?>
    <h2 class=”center”>Not Found</h2>
    <p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
    <?php get_search_form(); ?>
    <?php endif; ?>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Thank you. I’d appreciate any input.

  • The topic ‘Front page links dont stay in category’ is closed to new replies.