Adding text to links when not on the homepage

sThis doesn’t need jquery, just add a custom header for your pages and change the menu links in this header accordingly:

Copy the same header.php file and rename it to header-pages.php and edit its menu links to the following:

<ul>
     <li data-menuanchor="home">
         <a href="https://wordpress.stackexchange.com/">home</a>
     </li>
     <li data-menuanchor="about">
         <a href="/#about">about us</a>
     </li>
     ...
</ul>

In your pages use the following to import your customized header: (make sure it’s on the first line of course)

<?php get_header('pages'); ?>

PS: the scrolling process after link redirection will also be animated 🙂

Cheers!