I have a menu with parent and child. I created menu from admin panel using Appearance >> Menus with selecting page. But some of my parent pages content empty so i want to set link(null) when page content empty as like :
<a href='javascript:void()'> Page Name </a>
i can do it set custom menu and link. But i want it dynamic if it is possible? any idea
It’s hard to know if a link leads to an empty page without querying the database for each link in your menu first. That would certainly slow down your page loads.
You could try the following method though.
href
attribute to #Here is my proof of concept: http://jsfiddle.net/epilektric/mBjF3/1/
The HTML:
The jQuery: