• Resolved alok2010

    (@alok2010)


    I set up an archives page on my blog after learning how to do it without using a plugin. There’s only one problem: it shows only as many posts as on your homepage, i.e. what you’ve set in Admin area >> Settings >> Reading

    I’d like to know what code I should add/change in order for it to archive all the posts. Here’s my archives.php file:

    <?php
    /*
    Template Name: Archives
    */
    ?>
    <?php while(have_posts()) : the_post(); ?>
    <h1><?php the_title(); ?></h1>

    <h3>Categories</h3>

      <?php wp_list_cats(‘sort_column=name&optioncount=1’) ?>

    <h3>Monthwise</h3>

      <?php wp_get_archives(‘type=monthly&show_post_count=1’) ?>

    <?php endwhile; ?>
    <?php
    $posts_to_show = 100; //Max number of articles to display
    $debut = 0; //The first article to be displayed
    ?>
    <?php while(have_posts()) : the_post(); ?>
    <h3>All Posts</h3>

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

    • <?php the_time(‘d/m/y’) ?>: “><?php the_title(); ?>
    • <?php endforeach; ?>

    <?php endwhile; ?>

    P.S: If you have time, please kindly also resolve my other query here

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Archives Page not Showing all the Posts’ is closed to new replies.