In a wordpress theme, I am using the wp_list_pages() function to generate the list of pages and its working great however I need help making one of the links redundant.
This is what wp_list_pages is outputting and the one that I need to change:
<li class="page_item page-item-12"><a href="http://mysite.com/page3">Page 3</a>
<ul>
<li><a href="http://mysite.com/page4">Page 4</a></li>
</ul>
</li>
I would like this to be
<li class="page_item page-item-12">Page 3
<ul>
<li><a href="http://mysite.com/page4">Page 4</a></li>
</ul>
</li>
This is the JQuery that I am using:
<script>
$(document).ready(function() {
$(".page-item-12 a").removeAttr("href");
});
</script>
However, the Jquery is removing the links from all the < li > in the child ul as well which I do not want.
Thanks in advance.