简体   繁体   中英

Link to current page html

Have been searching some topics but don't think I have found the exact answer I was looking for hence I try here. In my Wordpress website I have a hardcoded button on around 150 pages on each top of a page. I would like to link to an angor text /#anchor halfway of each of this pages.

Now I don't want to enter every specific URL manually. Is there a HTML trick where you refer to the current URL, something in the order of: .com/currentpage/#anchor?

Thanks in advance for any help or tips.

You can add a link on current page without add a page url.

For hash

<a href="#currentPageLink">Link</a>

For QueryString

<a href="?currentpagelink=true">Link</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM