postsrc
postsrc

Reputation: 752

how to customize wp_nav_menu() fort icons

how can i add icon wo wp_nav_menus?.. this is the picture that i design

http://postimg.org/image/w7x2hfn75/

I want to make the first menu as an icon, are there possible way?..

my code

<?php 

    $defaults = array(
        'theme_location' => 'header-menu'
        );

    wp_nav_menu( $defaults ); 

?>

and i add the

'before'          => '',

it show the icon for every menus, i want single home icon

icon source http://fortawesome.github.io/Font-Awesome/icons/

Upvotes: 0

Views: 1493

Answers (3)

Ravi Patel
Ravi Patel

Reputation: 5211

Add Font Awesome 4 icons to your WordPress menus and site without touching a single line of code!

Install this wordpress plugin after active follow screenshort: Font Awesome 4 Menus

enter image description here

enter image description here

Upvotes: 2

Ganesh Kumar G
Ganesh Kumar G

Reputation: 185

You can create the site from that design and after that post the link to that so that I can give you the code for replacing first menu item to add icon.. Thanks.

Upvotes: 0

silver
silver

Reputation: 5331

If you are using font awesome, you can simply add something like below on the navigation Item label when you create a menu,

<i class="fa fa-home"></i>

You can also add something in wordpress HTML menu structure using CSS or Jquery,

No need to use PHP for a very simple thing like that

Upvotes: 0

Related Questions