• saphire2

    (@saphire2)


    So far I have 10 posts per page. And 2 pages for 20 posts. But now WordPress has automatically added a page 3 for more posts, which I want to delete. I have what looks like the code for it on the main index template, but can’t find out anywhere what to do with that code to delete page 3.

    <?php endif; ?>
    <div id="nextprevious">
    <div class="alignleft"><?php posts_nav_link('','','&laquo; PREVIOUS ENTRIES') ?></div>
    <div class="alignright"><?php posts_nav_link('','NEXT ENTRIES &raquo;','') ?></div>
    </div>
    </div></div> <!-- Closes Content -->

    Can anyone help please? Thanks very much.

Viewing 3 replies - 1 through 3 (of 3 total)
  • MichaelH

    (@michaelh)

    Typically, WordPress does the pagination based on the number of posts that you have written.

    Thread Starter saphire2

    (@saphire2)

    But wouldn’t that be tremendously unwieldy? And repetitive? 300 posts would mean 30 extra pages and all those posts are already listed in the archives. Plus I’m considering adding a category list. Plus an index.

    Are you saying there is absolutely no way to cut off the post pages at two pages for a total of 20 posts?

    MichaelH

    (@michaelh)

    Are you saying there is absolutely no way to cut off the post pages at two pages for a total of 20 posts?

    Nope, didn’t say that…you’d need to put a if test around your next_posts_link to stop after so many pages. Here’s an example using the index.php from the WordPress Default theme show such a test:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    if ($paged < 2) {
    ?>
    <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    <?php } // if $paged<=2 ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Delete 3rd page of posts’ is closed to new replies.