如何防止在Wordpress中单击带有子项的主菜单项? [英] How can I prevent a main menu item with sub items from being clickable in Wordpress?

查看:62
本文介绍了如何防止在Wordpress中单击带有子项的主菜单项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的网站: http://wake9.com/blogs/norcal-merced-wakesurfing-competition -2009/.

注意菜单项照片和结果".将鼠标悬停在它上面,您将看到子菜单项.我希望能够单击子菜单项,但主菜单项不应是页面或可单击的.我可以在菜单上获取此项目的唯一方法是使其成为页面.有没有一种方法可以让一个菜单项具有要包含内容的子菜单项,但是实际的菜单项却不可单击?我当时正在考虑使用JQuery删除锚标记,但这是一个真正的技巧,我想知道是否有更简单的方法.

Notice the menu item "Photos and Results". Hover over it and you will see sub menu items. I want to be able to click on the sub-menu items but the main menu item shouldn't be a page or be clickable. The only way i could get this item on the menu was to make it a page. Is there a way to just have a menu item that has sub menu items to content, but the actual menu item isn't clickable? I was thinking about using JQuery to remove the anchor tag, but that is a real hack and I want to know if there is an easier way.

提前谢谢!

推荐答案

一种选择是使用#".我试过了,它在我的博客中有效.

One option would be to use Page Links to plugin and set the main link as '#' . I tried this and it works in my blog.

这篇关于如何防止在Wordpress中单击带有子项的主菜单项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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