• How to add next and previous page icon on every page!
    I have 116.000 pages with photos, all uploaded with WP all import.
    And you have to search for the photo you are looking for.

    Svein

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator bcworkz

    (@bcworkz)

    You should be able to use next_post_link() and previous_post_link() even for pages. They’ll output links to the next later or earlier page just as they would for posts. Themes don’t normally do so on page templates because the concept next or previous page is often not applicable to the way most people use pages.

    The functions normally use the next/previous page’s title as link text, but you can pass icon HTML to the functions for use as the link “text”.

    I use <?php echo paginate_links(); ?> just before the closing article tag for all my archive pages. Then I inspected the page to see the classes I needed to style.

    Thread Starter svein1958

    (@svein1958)

    How can this be done, I am no expert, only used WP a couple of weeks.
    I have more than 116.000 single pages, so it would be nice to navigate next and previous page.
    Anyone who could explain it a little bit more how to do it!

    Svein

    Thread Starter svein1958

    (@svein1958)

    By the way, here is a address to my old pages; https://www.vossnow.net

    Svein

    Your post was in the developer’s forum – you have to add that to the template(s) that displays posts. You need to hire a developer or switch to a theme that adds the pagination links.

    Moderator bcworkz

    (@bcworkz)

    You can use the theme editor (under Appearance) to add the pagination links, but you need to know the right template. Themes vary on this, there are plugins to help you identify the right template. You also need to know where to put the link code. This can be through trial and error, provided you do so while maintaining proper syntax. This could prove to be very frustrating if you have no coding experience.

    You shouldn’t try to modify an active theme. Switch to another before attempting to edit your theme. If your theme is subject to updates, you shouldn’t modify it at all. Instead, create a child theme and edit that. While child themes can be relatively easy to set up, if you have no PHP coding experience it will likely be very difficult for you to do correctly. Hiring expert help may not be as extreme of a solution as it might initially sound.

    I’m glad paginate_links() works for kernix, but I’d avoid that one. Without passing the right parameters, it will typically not work correctly. Passing the right parameters can be tricky for a novice.

    bcworkz – what do you suggest? I’m pretty sure that what was in _s when I downloaded it and I just used it as is and it seems o be fine. The only thing I have to fix is a top and bottom border that is displaying on archive pages that do not have at least a page 2.

    I took a look at the link below and it looks like I have some work to do. I’ll have to find a theme that uses it and check out their parms.

    bcworkz – I just noticed I commented out the_posts_navigation();after the endwhile of “the loop” in my home.php template. Is that what you think would be better? Without any args or parms it just outputted “Older Posts” and “Newer Posts”.

    Thread Starter svein1958

    (@svein1958)

    bcworkz – Thanks for explain the complexity of it, it looks like I have to live with it as it is.

    Svein

    Moderator bcworkz

    (@bcworkz)

    kernix – if it works don’t fix it? ?? Doesn’t work for me without supplying some parms, even with the _s theme. Are you sure home.php is being used? I don’t think it’s used when static front page is selected in Settings. OTOH “front-page.php” is used for home regardless of the setting used. paginate_links() (with appropriate parms) is the only logical choice when a template is making it’s own custom query. If the template is using the default query, the_posts_navigation() is good, it ends up calling the previous and next post links functions that I initially mentioned in my first reply.

    If you have further questions regarding this, please start a new topic. I don’t know if Svein is that interested in getting notifications now that they’ve abandoned the idea. In any case, hijacking others topics is strongly discouraged in these forums. I know that is not your intention, and I kind of instigated it by doling out advice in passing. Lets not let it persist.

    No, I’m good – no need to reply if you don’t want and I guess this thread can be marked as resolved but then it’s not mine.

    I am not sure if I understand everything you said, but then I’m a newbie at this. I’m using front-page.php for my Home page and home.php for my main Blog page. I created EVERY template because I don’t know better and I figured I could delete some if I didn’t need them. Right now, I do not see and page using index or singular even though they are in my theme. My list of things to look at keeps growing and paginate_links and pagination is now on that list – just not at the top – thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to add next and previous page icon in every pages’ is closed to new replies.