WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. kahone
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

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

    WordPress Font Awesome Icons

  4. Skivsamlaren
    Member
    Posted 9 months 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
    Member
    Posted 9 months ago #

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

  6. Andrew
    Forum Moderator
    Posted 9 months 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