Forums

[resolved] Page not showing the amount of posts I want! (Code included) (3 posts)

  1. oo0Thomas0oo
    Member
    Posted 3 years ago #

    Hi,

    I have this blog: http://www.gadgeez.com and my problem is that the pages are not showing the amount of posts I want them to shown (I have set this up in wp-admin to 6). I don't want to use "query_posts("showposts=X");" because this causes problems with "previous entries" -and "next entries" - links getting malfunctioning!

    For example: When you click "phones" (menu), it shows more then 6 posts instead of only the 6 posts I want.

    Any ideas? What am I doing wrong?

    <?php get_header(); ?>

    <div id="contentwrapper"><div id="content">

    <div class="adsense_top"><?php include (TEMPLATEPATH . '/adsense_top.php'); ?></div>

    <?php /* If this is a category archive */ if (is_category()) { ?>
    <h2 class="pageTitle"><?php single_cat_title(); ?></h2> <? } ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); in_category('5'); ?>
    <? if( $post->ID == 66 ) continue; update_post_caches($posts); ?>

    <div class="post">
    <h2 class="postTitle">"><?php the_title(); ?></h2>
    <div class="postMeta">
    <span class="date"><?php the_time('M.d, Y') ?></span> in
    <span class="filed"><?php the_category(', '); ?></span>
    <span class="commentcount"><?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?></span>
    </div>
    <div class="postContent"><?php the_content('[Read the rest of this entry...]'); ?></div>
    </div> <!-- Closes Post -->

    <?php endwhile; ?>

    <?php else : ?>

    <div class="post">
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
    </div> <!-- Closes Post -->

    <?php endif; ?>

    <div id="nextprevious">
    <div class="left"><?php posts_nav_link('','','« previous entries') ?>  </div>
    <div class="right"><?php posts_nav_link('','next entries »','') ?></div>
    </div>

    </div></div> <!-- Closes Content -->

    <?php get_sidebar(); ?>

    <div class="cleared"></div>

    </div> <!-- Closes Main -->

    <?php get_footer(); ?>

    Thank you for helping me out!

  2. oo0Thomas0oo
    Member
    Posted 3 years ago #

    Bump.

  3. oo0Thomas0oo
    Member
    Posted 3 years ago #

    Problem solved using this:

    <?php
    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("cat=5&showposts=6&paged=$page");
    ?>

    Thanx anyway!

    Thomas

Topic Closed

This topic has been closed to new replies.

About this Topic