Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1012907
    armintz
    Participant

    is it possible in X to add a fontawesome icon inside of a Button shortcode? Or is it only possible to add these below?

    http://theme.co/x/demo/integrity/1/shortcodes/icons/

    Thanks

    #1013040
    Joao
    Moderator

    Hi There,

    Please have a look at this link:

    http://theme.co/x/demo/integrity/1/shortcodes/buttons/

    Hope that helps,

    Joao

    #1013041
    armintz
    Participant

    Hi @Joao, I’m familiar with your documentation about buttons. But I don’t see anything on here about implementing Font Awesome icons.

    I’ve tried adding an FA code inside an X button shortcode, but it didn’t show the icon. For example:

    [button class="pink-to-white" size="x-large" href="/gallery" title="Learn More"]Learn More&nbsp;&nbsp;<i class="fa fa-paw" aria-hidden="true"></i>[/button]

    the FA portion being this:

    <i class="fa fa-paw" aria-hidden="true"></i>

    #1013275
    Jade
    Moderator

    Hi there,

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Then add this code in the child theme’s functions.php file:

    function load_fontawesome() {
      ?>
        <script src="https://use.fontawesome.com/2b9387c6dc.js"></script>
      <?php
    }
    
    add_action( 'wp_head', 'load_fontawesome', 99999 );

    Hope this helps.

    #1013579
    armintz
    Participant

    worked perfectly @jade – thanks

    #1013938
    Friech
    Moderator

    We’re delighted to assist you with this.

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1012907 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>