| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Crankshaft
Join Date: Apr 2003
Posts: 2,103
|
wordpress pagination
So I found a tutorial about pagination - I set it up with the if have_posts loop but ti doesn't work. If I take out the if and else statements it works - the only problem with that is the else statement contains the 'no post - go back to the homepage' message. Anyone else have a solution to pagination? |
|
|
|
|
|
#3 (permalink) |
|
Don't touch my tea!
|
Put this line into the loop, just after the_content PHP Code:
You shouldn't have to take out the if and else statements, or mess around with any other elements of the loop. |
|
|
|
#5 (permalink) |
|
Crankshaft
Join Date: Apr 2003
Posts: 2,103
|
so this is the code with Bazzle's pagination code added that doesn't work: PHP Code:
this is the tutorial code that works but doesn't include the if statements PHP Code:
the same code within the if statements that gives me the 'next entries' link but when clicked I get the if statement 'no post - go to the homepage' PHP Code:
Last edited by Pete Nice : 08-07-2009 at 05:09. |
|
|
|
#7 (permalink) |
|
Crankshaft
Join Date: Apr 2003
Posts: 2,103
|
ok slags and byatches - thanks so much for all your help on my earlier post - and as per usual I sorted it out myself. I do have another question - no doubt it will sit here for a few hours until I work it out with maybe a couple of non-helpful posts added. I'm using this pagination query on my index page - now I need to get it to work on the archives page - just incase there's loads of posts in that month. Currently the query is ignoring the query string and just paginating all of the months rather than just the one being passed: PHP Code:
|
|
|
|
#9 (permalink) |
|
Crankshaft
Join Date: Apr 2003
Posts: 2,103
|
it's ok - Pete to the rescue - needed to add $query_string to the query: PHP Code:
once last thing - if someone could help me pass the date to the next page in the pagination that would be great. Currently it sits outside the while loop so only works on the original query. |
|
|
|
#10 (permalink) | |
|
Don't touch my tea!
|
Quote:
It doesn't work because you pasted it outside the loop. Paste it above the endwhile and it should work, like this: PHP Code:
I'm guessing you might want the page numbers to appear outside the loop for layout reasons. I wouldn't know how to go about that, but there's probably a way you can. |
|
|
![]() |
|