• Resolved Jane Milburn

    (@jane-milburn)


    Hi, I am using the latest version Twenty Seventeen child theme (I updated this week). I have searched everywhere and cannot find an answer to my question.

    I have pagination on three pages, however, it shows twice on the pages (Pages: 1 2 3 and underneath to the left it again says Pages: 1 2 3). I have not edited the site for a long time and have only just noticed this.

    I just want to keep the page numbers that are in bold under the gallery and remove the pagination that is grey and to the left.

    I do not know where the code for the paginations are placed. I understand it may have something to do with wp_link_pages which I found in Twenty Seventeen’s Single Page (page.php) and when I inspect the pagination that I want to delete on the site, it says <p class=”post-nav-links”>Pages: <span class=”post-page-numbers current” aria-current=”page”>1</span> 2 3</p>
    I have searched for this code in functions.php but cannot find anything in relation to this code.

    In case I am overlooking something, I looked in the page text and the site css and there seems to be nothing there regarding the pagination.

    Any help to remove the second pagination would be much appreciated.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • I do not know where the code for the paginations are placed. I understand it may have something to do with wp_link_pages which I found in Twenty Seventeen’s Single Page (page.php)

    The page.php of 2017 theme doesn’t have a call to wp_link_pages() presented in the file itself (it gets called by template-parts/page/content-page.php), so please check if you really have 2017 theme in its original form, not an edited one.

    Precaution, before doing any changes to theme files, it’s good practice to always have full site backup. Just in case something goes wrong we can get the site back up in its previous condition.

    Another thing is the site’s parent theme (twenty seventeen) style.css says it is version 2.0 (11 months ago, long before WP5.3), the latest is 2.2, so it’s possible that if you update the theme to the latest version the problem might get resolved.

    If after taking care of the parent theme and problem persists, try disabling all plugins, this will rule out that the problem is from theme files or plugin(s). If with all plugins disabled the problem still there, theme (parent and/or child) is the culprit. If all plugins disabled and the problem is gone, try re-enabling them one by one to rule out the one that causes it.

    Since your child theme doesn’t have anything in stylesheet (other than the header info indicating the parent theme). Try looking in your child theme functions.php file, there could be a function that injects additional nav links. If your child theme has page.php look into it see if there is a call to wp_link_pages(), as mentioned earlier there must not be a call to this presented in page.php otherwise it gets double display.

    Thread Starter Jane Milburn

    (@jane-milburn)

    Thank you for your explanation.

    I do not have a page.php in the child theme. On my dashboard it says I have version 5.3 and I can see it is version 2.0 in the Twenty Seventeen style.css as you said. I am not aware if I have edited the main theme as I know not to, however I may have added the wp_link_pages() to the page.php and have now forgotten if I did that, either way, as you say this is probably what has caused the double. As I have version 5.3 already, I do not know how to update just the style.css can you please tell me how to do this, I have searched and cannot find how to do this?

    I do not think my child theme functions.php has any issues. Here is what I have:
    https://pastebin.com/m11fmXhV

    After I have backed up and updated the style.css I will follow your further instructions but if nothing changes then, could I possible just remove the <?php wp_link_pages(); ?> code from the Twenty Seventeen main theme?

    Yes, go ahead and remove that function, but do it only if you’ve done this before (editing php file on a live site) and understand what could happen and know exactly how to revert the change (meaning you have theme files backup available and ready to revert the changes via FTP or hosting’s file manager).

    Just so you know there is an alternative to editing php file, just add this to Additional/Custom CSS section.

    
    p.post-nav-links { display: none; }
    
    

    Also keep in mind since you have quite a lot of CSS code in Additional/Custom CSS, make sure you keep a copy of it for backup. Actually all of this additional CSS code should be in your child theme stylesheet, also the modified php file too should be in child theme folder, that’s the purpose of having a child theme.

    On a sidenote here, 2017 theme is getting old, maybe it’s time to consider changing to a newer theme? It’s not that complicated, just setup a staging site (probably in sub domain or do it in local machine), import content from the live site into it and play around with new theme until you get the design you want, then upload the theme to the live site.

    Thread Starter Jane Milburn

    (@jane-milburn)

    Thank you so much for the time and effort you’ve put into this. The CSS code worked and I will now work on all of your suggestions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove page number, pagination.’ is closed to new replies.