[Resolved] Where can I put code to Font Awesome?

Home Forums Support [Resolved] Where can I put code to Font Awesome?

Home Forums Support Where can I put code to Font Awesome?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #746889
    Jesús

    Hello!

    My icons don´t show to menu. I´ve installed plugin Awesome but I think that I need this:

    add_action ('wp_enqueue_scripts', 'tu_load_font_awesome');
    / **
     * Enqueue Font Awesome.
     * /
    función tu_load_font_awesome () {
        wp_enqueue_style ('font-awesome', '//use.fontawesome.com/releases/v5.3.1/css/all.css', array (), '5.3.1');
    }
    

    https://docs.generatepress.com/article/font-awesome/

    But… Where can I put this code? ¿Functions.php?

    Thanks!

    #746922
    Tom
    Lead Developer
    Lead Developer

    If you’re using a child theme, functions.php is best.

    If not, one of these methods will work: https://docs.generatepress.com/article/adding-php/

    #747234
    Jesús

    Hello!

    I don´t know what I´m doing bad…

    1. I´ve created a theme child.
    2. I´ve added the function and plugin of Font awesome.
    3. I insert this:

    And not work 🙁

    #747238
    Leo
    Staff
    Customer Support

    Looks like it should work.

    Any chance you can link us to the site in question?

    You can edit the original topic and use the private URL field.

    Let me know 🙂

    #747253
    Jesús

    Hello Leo!

    I´ve added my web in my post.

    Thank!

    #747255
    Leo
    Staff
    Customer Support

    Can you clear and then disable the caching plugin to test?

    #747264
    Jesús

    I´ve cleaning caché, regenerate css, purge the url.. and i´ve disable the plugin to cache but not work 🙁
    You can checked.

    Have you other idea? 🙂

    #747289
    Tom
    Lead Developer
    Lead Developer

    A plugin you’re using is adding Font Awesome 4.7 improperly. They should be adding the version number so WordPress uses the latest version (your function).

    Since this plugin is adding 4.7 anyways, you might as well use those icons: https://fontawesome.com/v4.7.0/

    #747299
    Jesús

    Yes!

    Perhaps, I use too Menu Icons!
    Could I resize the space between icons? I´m using: menu-item-float-right But space between icons is a little big…

    Thank you!

    #747549
    David
    Staff
    Customer Support

    Hi there,

    try this CSS:

    .main-navigation ul li.menu-item-float-right a {
        padding-left: 15px;
        padding-right: 15px;
    }
    #747576
    Jesús

    wow, this work!

    Thank you! 🙂

    #747606
    David
    Staff
    Customer Support

    You’re welcome. Glad we could be of help.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.