[resolved] Font awesome icon for home-link (6 posts)

  1. kahone
    Posted 3 years ago #

    I want to change the "home" text in the menu to font awesome icon (icon-home)
    I have twenty twelve theme and font awesome activated, but I cant get it changed to the default menu.

  2. kahone
    Posted 3 years ago #

    Found the answer: add the icon-code as value to show_home in header.php
    <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'show_home'=>'<i class="icon-home"></i>') ); ?>

    I didn't know it's a string value at first but rather boolean show/hide.

  3. terrytsang
    Posted 3 years ago #

    I have made a wordpress font awesome icons plugin as well, you all can have a try :)

    WordPress Font Awesome Icons

  4. Skivsamlaren
    Posted 2 years ago #

    My solution for the Quark theme, which sort of is based of Twenty Twelve:
    In wp-admin > Appearance > Menus > Navigation Label, I added:
    <i class="fa fa-home fa-lg"></i>

  5. Sinac
    Posted 2 years ago #

    Skivsamlaren it is better solution, but <i> will be nested in <a>
    this is may incorrect for SEO.

  6. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    It's incorrect for multiple reasons to use empty HTML just to style things. You can use the :before and :after pseudo selectors in CSS for the same purpose without such issues.

Topic Closed

This topic has been closed to new replies.

About this Topic