how to add font-awesome icon in wordpress wp_nav_menu() -
i trying show menu in wordpress using wp_nav_menu(); due less knowledge can't understand how task. kindly me , please share code if have idea.
<div class="pull-left"> <nav> <ul class="sf-menu sf-js-enabled sf-shadow l_tinynav1" id="nav"> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>" class="first-level-link sf-with-ul"> <div class="menu-icon"><i class="icon-home icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">home</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=4" class="first-level-link"> <div class="menu-icon"><i class="icon-user icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">about us</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=6" class="first-level-link"> <div class="menu-icon"><i class="icon-cogs icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">services</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=8" class="first-level-link"> <div class="menu-icon"><i class="icon-briefcase icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">projects</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=10" class="first-level-link"> <div class="menu-icon"><i class="icon-key icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">careers</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=12" class="first-level-link"> <div class="menu-icon"><i class="icon-comments icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">faq</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=14" class="first-level-link"> <div class="menu-icon"><i class="icon-envelope-alt icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">contact</div> </div> </a> </li> </ul> </nav> </div>
now using static , 1 more thing facing active menu issue too. please share code me or telme how can add active class in static menu 1 clicked show position now.
<div class="pull-left"> <nav> <ul class="sf-menu sf-js-enabled sf-shadow l_tinynav1" id="nav"> <?php echo $page_id = $post->id; ?> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>" class="first-level-link <?php if(is_home()){ echo "active"; }?> sf-with-ul"> <div class="menu-icon"><i class="icon-home icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">home</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=4" class="first-level-link <?php if($page_id==4){echo "active";}?> "> <div class="menu-icon"><i class="icon-user icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">about us</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=6" class="first-level-link <?php if($page_id==6){echo "active";}?>"> <div class="menu-icon"><i class="icon-cogs icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">services</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=8" class="first-level-link <?php if($page_id==8){echo "active";}?>"> <div class="menu-icon"><i class="icon-briefcase icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">projects</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=10" class="first-level-link <?php if($page_id==10){echo "active";}?>"> <div class="menu-icon"><i class="icon-key icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">careers</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=12" class="first-level-link <?php if($page_id==12){echo "active";}?>"> <div class="menu-icon"><i class="icon-comments icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">faq</div> </div> </a> </li> <li class="first-level-li"> <a href="<?php bloginfo('url'); ?>/?page_id=14" class="first-level-link <?php if($page_id==14){echo "active";}?>"> <div class="menu-icon"><i class="icon-envelope-alt icon-large"></i></div> <div class="menu-item-wrapper"> <div class="first-level-li-text-link">contact</div> </div> </a> </li> </ul> </nav> </div>
active class added using custom code.
Comments
Post a Comment