在 WordPress 菜单冲突中添加自定义锚链接和页面链接 [英] Adding custom anchor links and page links in WordPress menu clash

查看:25
本文介绍了在 WordPress 菜单冲突中添加自定义锚链接和页面链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了两个页面,一个用作单页网站,另一个用作博客.我在我的 onepage 部分上有指向 onepage 的关于"、投资组合"等的锚链接.我有一个指向博客"的页面链接.

I've created two pages, one to act as a onepage site and one for the blog. I have anchor links on sections on my onepage to 'about', 'portfolio' etc. for the onepage. I have a page link to 'blog'.

在我的菜单上,我已将每个部分的自定义链接创建为 #about 和 #portfolio,这很好用.但是,如果我进入博客并尝试使用菜单返回页面上的某个部分,则无法正常工作,因为我获得了 www.example.com/blog#about

On my menu I have created custom links to each section as #about and #portfolio and this works fine. However, if I go into the Blog and try to use the menu to go back to a section on the onepage it doesn't work as I get www.example.com/blog#about

但是如果我将菜单中的锚链接设置为 http://example.com#abouthttp://example.com#portfolio 等然后none 锚链接工作.我被困住了.希望得到一些帮助

But if I set the anchor links in the menu to http://example.com#about, http://example.com#portfolio etc then none of the anchor links work. I'm stuck. Would love some help please

推荐答案

已解决:比我想象的要容易.onepage 被命名为home",所以我需要做的就是创建自定义链接,例如:http://www.example.com/home#portfolio

Solved it: Easier than I thought. The onepage was named 'home' so all I needed to do was create custom links like: http://www.example.com/home#portfolio

这篇关于在 WordPress 菜单冲突中添加自定义锚链接和页面链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆