yesmaybe
Member
Posted 1 year ago #
Hi,
Somewhere on the menu settings, there should be an option to choose #no-link for each menu item, so if you have a heading category with no content you can skip directly to the offspring.
While I see the integrated menu works well on small sites, it can be time consuming to set-up and manage on larger sites as it seems not to make use of the wp_list_pages() call.
It has the ability to add top-level pages, why can't this be extended to individual posts added to a certain category?
yesmaybe
Member
Posted 1 year ago #
As a work around I am making a custom link URL #no-link with Label category name. This duplicates my work, but means that a parent category heading can be a null-link.
Any better ideas?
Rand HOPPE
Member
Posted 1 year ago #
I've just come up against this, as well. Forgive my cluelessness, but can you describe your workaround in a little more detail?
Rand HOPPE
Member
Posted 1 year ago #
Rand HOPPE
Member
Posted 1 year ago #
Oh, that doesn't really do it, it just sets up a link to #
Does your workaround make NO link?
If you're using jQuery, one solution would be to target the link and remove the 'a' tag altogether. I'm using something like this and it works great, taking the links off only the parent categories.
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery('li.menu-item-type-taxonomy > a').contents().unwrap();
});
</script>
<--jQuery dork
Where in the template would you post this script - in the head element or somewhere within the nav div itself?
sreijnho
Member
Posted 1 year ago #
I know what you mean...and better yet...I have the solution!!!
It's simple: Just add a 'custom link' to your menu. The url off that link doesn't have to exist, it can be like 'http://a' or something. When you added this link, just go to that custom link in your menu, unfold it and delete the URL.
Now you have a category in you menu that is NO LINK!!!
aliceralph
Member
Posted 1 year ago #
sreijnho, thank-you so much!! This worked perfectly and such a simple (but not obvious) fix!
yesmaybe you should mark this as 'resolved'