i want to remove the automatic a href link from the function wp_list_pages()
on wordpress menu, but i do not want to remove the href form the sub menu, only from the top menu
for example:
<li><a href="www.games.co.il">Games-not remove thr href</a>
<ul>
<li><a href="www.x4.co.il">Menu0-remove the auto href</li>
<ul>
<li><a href="www.x1.co.il">sub-menu 1-do not remove the auto href</a></li>
<ul>
<li><a href="www.ddd.co.il">**not** remove the href</li>
</ul>
<li><a href="www.x1.co.il">sub-menu 2 not-remove the auto href</li>
</ul>
</ul>
</li>
Target the links in LI's that are direct children of the main list..
$("ul#menu > li a").removeAttr("href");
http://api.jquery.com/child-selector/
Or leave the url in place and return false on them..
$("ul#menu > li a").click(function(){ return false; });
The URL would appear in the browser still, but clicking the link would do nothing(if JS is enabled).