Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

burakakin on "how to add javascript:void(0); in main nav items"

$
0
0

Hello ,
I am a newbie in wp. I created my main menu but I cant use dropdowns correctly I am trying to convert :

<nav>
  <ul id="navigation">
    <li class="current_page_item"><a href="index.html"><span>Home</span></a></li>
    <li class="drop"><a href="javascript:void(0);"><span>Features</span></a>
  </ul>

I cant add js to href items until now I came up with the solution :
<?php wp_nav_menu( array('menu' => 'Main','menu_id'=>'navigation','link_before' => '<span>','link_after' => '</span>')); ?>

and in functions :

add_theme_support('nav-menus');
if(function_exists('register_nav_menus')){
	register_nav_menus(
		array(
			'main'=> 'Main Nav'
			)

can you help me to add js ?


Viewing all articles
Browse latest Browse all 8245

Trending Articles