Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #869813

    jsjmccracken
    Participant

    Hello,

    I followed the following steps to upload the child theme found here: https://community.theme.co/kb/how-to-setup-child-themes/

    I would like to know how to access the functions.php file so I can activate the font awesome library in order to add icons to my menu bar.

    I’m new to X Theme and WordPress and can’t figure this out…

    Thank you in advance!

    Jacob

    #869871

    Christopher
    Moderator

    You will need to access your child theme via FTP and create the file in your Child Theme. The functions.php file is not already in the Child Theme and you can add it manually. For more detailed information please kindly read this article: https://codex.wordpress.org/Functions_File_Explained

    Hope it helps 🙂

    #870407

    jsjmccracken
    Participant

    Thank you for the reply! I was able to access the functions.php file and I added the following code:

    function my_custom_head_output() {
    ?>
    <link href=”//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css” rel=”stylesheet”>
    <?php
    }
    add_action( ‘wp_head’, ‘my_custom_head_output’, 99999 );

    The code comes from: https://community.theme.co/forums/topic/updating-font-awesome/

    I then transferred the saved functions.php file into the child theme and then through FTP to my host file manager.

    When I type fa fa-home in my menu css classes and then save the menu, it doesn’t show the home icon.

    Do I need to input that somewhere else or change the code? The link I got the code says it can be used like <i class=”fa fa-camera-retro fa-lg”></i> but I’m not sure where to put that either.

    Where do I input fa fa-home?

    Thank you!

    Jacob

    #870758

    Lely
    Moderator

    Hi Jacob,

    That code should work unless you’re using prettyquotes.
    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #871350

    jsjmccracken
    Participant
    This reply has been marked as private.
    #872229

    Rue Nel
    Moderator

    Hello There,

    The given ftp credentials is not working for us. Please double check the username and password. For the meantime, could please post in your reply below the actual contents of your child theme’s functions.php file?

    Thank you.

    #872346

    jsjmccracken
    Participant
    This reply has been marked as private.
    #872916

    Paul R
    Moderator

    Hi Jacob,

    You need to add it in your child theme’s functions.php file. It’s located in wp-content/themes/x-child/functions.php

    The code you posted is from the main xtheme functions.php file.

    With regards to adding icons to your menu, you can add the icon code directly in your navigation label

    eg. I added <i class="x-icon x-icon-home" data-x-icon="&#xf015;" aria-hidden="true"></i>

    http://screencast.com/t/mZC58vwZ

    Hope that helps

    #872990

    jsjmccracken
    Participant

    Thank you for the help! If I want to use different icons how do I find the attribute that goes in the quotes in data-x-icon=””? I tried replacing “home” with “envelope” for the contact icon but it still came up as the home icon.

    #873019

    jsjmccracken
    Participant

    I found the cheatsheet 🙂 https://fortawesome.github.io/Font-Awesome/cheatsheet/

    Another question: How do I change the font color in the menu bar? Is there css code I can add to the Custom>Edit Global CSS to do that?

    Thanks again!

    #873703

    Prasant Rai
    Moderator

    Hello There,

    Thanks for writing in!

    You can change the navigation menu font color from Appearance > Customize > Links Text > Navbar links.

    Thanks.

    #876958

    jsjmccracken
    Participant

    Thank you for the help 🙂

    #877691

    Rupok
    Member

    You are welcome!

    Glad that it helped. Feel free to let us know if you face any other issue. We’ll be happy to assist you.

    Thanks for using X.

    Cheers!

    #1040009

    Rick L
    Participant

    I finally figured it out through this resource: https://wordpress.org/support/topic/how-to-add-codes-in-functionphp.

    #1040055

    Rahul
    Moderator

    You are welcome!