WordPress Anchor links

This is my first time making a custom WordPress website. The website is mostly one page except for the posts that take you to a single.php page. From the single.php page I figured out that if I add this code:

<?php echo get_option('home'); ?> 

to the logo I’m able to go back to the home page. However, my menu links are anchor links that are located in the home page. I haven’t figured out how to properly link these menu links so they’ll go to the right place in the home page.

Read More

Thanks for your help in advance!

Related posts

2 comments

  1. If you’re adding these menu items in the Admin, and if the sections on your page have id attributes, you can change the link to them using the following structure:

    #id-of-section
    

    …or, using a regular link:

    <a href="#id-of-section">Link</a>
    

Comments are closed.