I have a header.php, that appears in every single page on my blog, with a navbar that looks like this:

    <li><a href="<?php echo get_permalink(4); ?>">Logistics</a></li>
    <li><a href="<?php echo get_permalink(5); ?>#contact">Contact</a></li>      

But when I click the anchor tag linking to #contact, which is located in page with id 5, as you can see by the php code, nothing happens. I tried using a slash (/#contact) but I keep getting the same behavior. Isn’t this the correct way of linking to a specific id on another page?


Read more here: Linking to specific ID on another WordPress page?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: