In my admin section I would like to add in Appearance > Menus > some custom pages to add to my menu. I have two different menu one for the home page and one for the others pages. In my home page menu I add the menu elements as link because I need to give to the href the id of html element so i can 'redirect' in a specific point in my page, so my link is '#gallery'. In the menù for all the other page I the link should be 'http://my_domain/home/#gallery. Is there a way to add dinamically this link to the page list? I hope I was clear. Thanks

  • I have just added a Custom Link menu item, href is example.com/contact/#content and when I am in the contact page, the menu item works fine, in terms of jumping to content using the ID of the division without reloading the page.. – Samuel Elh May 10 '15 at 18:38
  • I'm developing in local so my custom link will be localhost/folder_name/home/#content. If I just add the link when I'll deploy my blog I will need to change all this link. I'm looking for a dynamic method to do that. – TWONEKSONE May 11 '15 at 8:08
  • Then add only /home/#content as a link.. – Samuel Elh May 12 '15 at 21:52

Go to the custom link tab, and in the url box just add: ?page_id=[id_number]#[anchor]

That's what worked for me after a little playing around. Make sure WordPress doesn't add http:// before it.

Other thoughts: Would be nice if WordPress just had an extra box to go with the pages where you could just paste in the anchor.

  • Though I must add on, I was doing this for pages. I imagine you would write ?p=[id_number]#[anchor] – Bagnome Feb 6 '18 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.