简体   繁体   English

链接到当前页面html

[英]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. 在我的Wordpress网站上,我在页面的每个顶部都有一个大约150页的硬编码按钮。 I would like to link to an angor text /#anchor halfway of each of this pages. 我想链接到每个页面中间的angor文本/#锚。

Now I don't want to enter every specific URL manually. 现在我不想手动输入每个特定的URL。 Is there a HTML trick where you refer to the current URL, something in the order of: .com/currentpage/#anchor? 是否有一个HTML技巧,你引用当前的URL,顺序为:.com / currentpage /#anchor?

Thanks in advance for any help or tips. 预先感谢您提供任何帮助或提示。

You can add a link on current page without add a page url. 您可以在当前页面上添加链接而无需添加页面URL。

For hash 哈希

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

For QueryString 对于QueryString

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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