Support » Fixing WordPress » WP 3.0 bug with pagination? (when using static page as homepage)

  • Resolved mjepson



    Our users have reported trouble with our custom page templates when using a static homepage. The page template has a query_posts with pagination in it. Here is an example for our standard blog page template:

    Template Name: Blog
    <?php get_header(); ?>
    <?php global $woo_options; ?>
    	<?php woo_crumbs(); ?>
    	</div><!-- /#top -->
       <div id="content">
    	<div class="col-full">  
            <!-- #main Starts -->
            <div id="main" class="col-left">      
    		$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
            <?php if (have_posts()) : $count = 0; ?>
            <?php while (have_posts()) : the_post(); $count++; ?>
                <!-- Post Starts -->
                <div <?php post_class(); ?>>
                    <h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
                    <div class="entry">
    					<?php global $more; $more = 0; ?>
    					<?php the_content(); ?>
                </div><!-- /.post -->
            <?php endwhile; else: ?>
                <div class="post">
                    <p><?php _e('Sorry, no posts matched your criteria.', 'woothemes') ?></p>
                </div><!-- /.post -->
            <?php endif; ?>  
    	        <div class="post-entries">
    	            <div class="post-prev fl"><?php previous_post_link( '%link', '<span class="meta-nav">&laquo;</span> %title' ) ?></div>
    	            <div class="post-next fr"><?php next_post_link( '%link', '%title <span class="meta-nav">&raquo;</span>' ) ?></div>
    	            <div class="fix"></div>
            </div><!-- /#main -->
            <?php woo_main_after(); ?>
            <?php get_sidebar(); ?>
    	</div><!-- /#col-full -->
        </div><!-- /#content -->
    <?php get_footer(); ?>

    This worked fine in all our themes in WP 2.9.2, and works fine in WP 3.0 as a normal page:

    Blog page 1:
    Blog page 2:

    If you set it up as static page homepage:

    It shows only the page title of that page:

    Exactly the same page template as static homepage in WP 2.9.2:

    I couldn’t see any changes on the codex page for query_posts, so I’m thinking this might be a bug?

    Copying the page template (template-blog.php) to home.php works fine as well.

    Another note, it doesn’t matter which static homepage you select… It can be a normal page, it doesn’t have to be the page template in question. The page template stops working when you set a static homepage.

Viewing 1 replies (of 1 total)
  • If I add cat=& to the query, the page shows, but pagination doesn’t work…

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

    If I echo $paged on /?paged=2 it simply outputs 1

Viewing 1 replies (of 1 total)
  • The topic ‘WP 3.0 bug with pagination? (when using static page as homepage)’ is closed to new replies.