Forums

Archives only shows 10 posts (5 posts)

  1. geldpress
    Member
    Posted 10 months ago #

    Since I upgraded to 2.7, my archives page only shows 10 posts. Im using a pretty common archive loop and it does not matter what I set the "psts_to_show" variable to - it always shows exactly 10 posts. It was working perfectly - showing ALL POSTS - before the upgrade.

    My archives are at:
    http://www.geldpress.com/archives

    The archives.php is shown below:
    <?php
    /*
    Template Name: Archives
    */
    ?>

    <?php get_header(); ?>

    <div class="page_archives_div">

    <div class="ar_panel">
    <h2>Archives By Category:</h2>
    <ul class="dark">
    <?php wp_list_categories('title_li='); ?>

    </div>

    <div class="ar_panel2">
    <h2>Archives By Month:</h2>

      <?php wp_get_archives('type=monthly'); ?>

    </div>

    <?php
    $posts_to_show = 1000; //Max number of articles to display
    $debut = 0; //The first article to be displayed
    ?>
    <?php while(have_posts()) : the_post(); ?>
    <h2><?php the_title(); ?></h2>

      <?php
      $myposts = get_posts('numberposts=$posts_to_show&offset=$debut');
      foreach($myposts as $post) :
      ?>

    • <?php the_time('m/d/y') ?>: "><?php the_title(); ?>
    • <?php endforeach; ?>

    <?php endwhile; ?>

    <?php get_footer(); ?>

  2. ronchicago
    Member
    Posted 10 months ago #

    what does your admin say > settings > reading > Blog pages show at most

  3. geldpress
    Member
    Posted 10 months ago #

    That did it! Thank you Ron. I guess the previous version of Wordpress I had running (2.5) ignored that parameter.

    Problem fixed! Thanks again!

  4. geldpress
    Member
    Posted 10 months ago #

    Sorry, I spoke to soon. Now that I changed my "max pages to show" setting, my home page now tries to display EVERY SINGLE POST instead of the first 10.

    Perhaps this is really an issue with wordpress 2.7. I want to use the "max pages to show" variable to decide how many posts to show on the main blog page. Displaying hundreds of posts on the home page will make the blog VERY SLOW. But this should not affect my archives page, where I want to display the TITLE ONLY of the last 100-150 posts.

    The way I see it, my existing archives.php code needs to be rewritten so it does not look at the max pages variable. Any ideas on how to fix my archives.php code is apprecaited.

  5. ronchicago
    Member
    Posted 10 months ago #

    i looked at four themes and none have the $posts to show...

    i wish i could offer something better than just comment out the php blurb and see what happens.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.