• Hey,

    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:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    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: https://cl.ly/6716a2a1fd3e314deac5
    Blog page 2: https://cl.ly/969377b06da3669e9b53

    If you set it up as static page homepage:

    https://cl.ly/ebffedf37b7a3c5d709b

    It shows only the page title of that page:

    https://cl.ly/8a3addadd9defe9dbce2

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

    https://cl.ly/9eff8e3a1ec33a5b9f51

    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.

    —-

    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 5 replies - 16 through 20 (of 20 total)
  • Hmmm, although the page loads properly now given the proper url (/page/2/, /page/3/, etc), the pagination links are not working. On /page/2/ I only get a Next link that is linking to /page/2/. Same on page 3.

    As before it works fine when this static page is not the front page. As soon as I set it to the front page this behavior manifests. If I specify ‘global $paged;’ before Nathan’s if statement it fixes the pagination links.

    It’s not just messing with blog post pagination.

    It also breaks pagination for new products at the bottom of my store that I created with the eShop plug-in. I’m not even using the blog part of wordpress for that, I’m just using static pages.

    I get a 404 if I click on the next page or the show all links. On all other pages the pagination works fine but not the static front page. Seems like a bug to me since the pagination was working perfectly right before I updated.

    Hi there,

    Has anyone found a definitive solution to this? I’m using wp-pagenavi, and have tried to implement nathanrice’s solution but it doesn’t seem to work…

    Just to clarify – I’m using home.php to return a specific category of posts here

    but at the moment /?paged=2 (i’m not using permalinks for now) just doesn’t do anything, returning the same results as before…

    Found the solution

    It’s the query_posts line I was using that caused it.

    Solution here if anyone else needs it:

    https://stylizedweb.com/2008/08/13/query_posts-pagination-problem/

    Thanks Nathan, query_posts( array( 'cat' => -0, 'paged'=> $paged ) ); was the answer for my problem using Paginator.

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