• I would like to have a different number of post on the home page then my archive and category pages.

    I have found this code

    <?php
    $page_num = $paged;
    if ($pagenum='') $pagenum =1;
    query_posts('showposts=7&paged='.$page_num); ?>
                   	<?php if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
                    // WordPress loop
                    endwhile;endif; ?>

    Everything works great on the main page except when I click on the Older entries link. One the second 3rd page I get a 404 error.

    Can some one please explain why I would get a 404 error and what I might do to solve this problem.

    Thanks
    -Mike

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try this code instead

    <?php
    if (is_front_page) {
      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
      query_posts("$query_string&showposts=7&paged=$paged");
    }
    ?>
                   	<?php if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
                    // WordPress loop
                    endwhile;endif; ?>

    You can proberly drop the empty $query_string …

    You’re just passing an empty variable into the query …

    query_posts("showposts=7&paged=$paged");
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custome # of post on index.php’ is closed to new replies.