Jump to content

Wordpress pagination problem: Adding extra page with no posts in there


pealo86

Recommended Posts

I have set up a form on the following page that sends the values of all of its fields to a template page that creates a loop out of the values using $_GET variables. Click the link below to see the results of a search (to save you having to fill the form in):

http://bit.ly/buRKvQ

 

At first, I couldn't get the pagination to work properly, clicking 'next' simply displayed no results, as if the loop did not pull any posts in.

 

Suddenly I seem to have got it working (not sure what I did differently to the last time I attempted to fix it, but oh well). However there should only be two pages of results, with a maximum of two posts on each but WordPress adds a third page of results.

 

There should only be 3 posts; 2 posts on one page, 1 post on the second. This is how it should be, however the 3rd (and unnecessary) page displays no posts, so I cant understand why WP is adding it??

 

I have tried echoing the $paged variable and it gives me some very strange results (see on the page), they seem to be numbered '0, 2, 3'.

 

Shouldn't it be '0, 1, 2' or '1, 2, 3'?? I assume the problem is somehow related to the $paged variable.

 

If anybody has any advice that would be great :D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.