How do I modify wp_nav_menu() link hrefs?
-
I’m building a site that will use AJAX or Flash combined deep-linking to display content using WordPress as the CMS. Right now, my wp_nav_menu() output looks like this (I snipped id and class attributes since they aren’t relevant):
<pre><code><div class="menu-header"> <ul id="menu-header-navigation" class="menu"> <li ...snip...><a href="https://example.tld/">Home</a></li> <li ...snip...><a href="https://example.tld/page-1/">Page 1</a></li> <li ...snip...><a href="https://example.tld/page-2/">Page 2</a></li> <li ...snip...><a href="https://example.tld/page-3/">Page 3</a></li> </ul> </div>
All I want to do is insert “#/” between the domain and the slug, so they look like this:
<pre><code><div class="menu-header"> <ul id="menu-header-navigation" class="menu"> <li ...snip...><a href="https://example.tld/">Home</a></li> <li ...snip...><a href="https://example.tld/#/page-1/">Page 1</a></li> <li ...snip...><a href="https://example.tld/#/page-2/">Page 2</a></li> <li ...snip...><a href="https://example.tld/#/page-3/">Page 3</a></li> </ul> </div>
Is there a way I can do this through hooks or something?
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How do I modify wp_nav_menu() link hrefs?’ is closed to new replies.