Forums

custom pagination on a custom word press page problem with page links (2 posts)

  1. maximus83
    Member
    Posted 9 months ago #

    Hi, this problem is driving me nuts.

    I am calling mysql database and displaying all the results fine on a custom page template within my wordpress site.

    I wanted the data to be paginated to six rows per page, and achieved this with my custom code, and got the links to show up for the number of pages too. The problem is when ever I click on the next link or one of the page links I just get the first set of results.

    I'm starting to think this is a wordpress issue perhaps something to do with the url and query string. my url for the next link is :

    http://www.xxxxxxx.com/wordpress/?page_id=1072?s=6&np=3

    s=start of dartabase which in this case for page 2 is 6 and np is the number of pages. I'm not sure why the first page of results is still been displayed, does anybody have any soultions?

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

  2. maximus83
    Member
    Posted 9 months ago #

    I've found that if i set start to row 6 ($start=6 , instead of $start=0) or any other number in the middle of the rows record and then click on the link for page 1 thus start becomes 0 the link works correctly.

    http://www.xxxxxx.com/wordpress/?page_id=1072&s=0&np=3 - this works to display page 1

    this doesn't work I just get a 404 page
    http://www.xxxxxx.com/wordpress/?page_id=1072&s=6&np=3 can't understand why only s=0 works in the url string any ideas?

    [No bumping, please.]

Reply

You must log in to post.

About this Topic