• Hi all, I’ve taken over a site from another developer (who has vastly more skill than me!) and I can’t figure out how to get the pagination working on certain pages. The page in question displays a list of pages (each item in the list is a course that the user can purchase) & each course is set up as a page (as opposed to a post).

    He had written some custom pagination code but this doesn’t work.

    It may have something to do with this line:
    echo '<a style="'.$highlight.'border:1px #ccc solid;padding:2px 5px;display:inline-block;margin:6px 4px;" href="/index.php?page_id=29&paged='. $x. '" class="page larger">'. $x. '</a>';

    I suspect where he has added the url in that line might be a problem as I don’t think that page exists anymore. It also seems quite a complicated way of doing it?

    The full code is here:
    http://pastebin.com/BFQrvknC

    If someone could have a look at the code I’d be most grateful!

Viewing 2 replies - 1 through 2 (of 2 total)
  • It looks like page 29 is supposed to be the current page where the list is displayed. If you have changed the page to a different one, you will need to use its ID instead.

    You could probably save the current page ID at the top of the code where the page title is echoed, and use the value in the navigation code so it would work no matter which page was used.

    If this does not help, please post a link to your site so the display can be compared to the code.

    Thread Starter dmx09

    (@dmx09)

    Tried changing the page id to the correct page but that unfortunately didn’t work. Not to worry, I might try another method.

    Many thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pagination for pages’ is closed to new replies.