This topic has 10 replies, 3 voices, and was last updated 7 years by tonari.

  • Author
  • #155051
     tonari
    Participant

    Hello, i would like to load the font awesome localy and not from maxcdn.bootstrapcdn.com .
    I saw this hook on another post and i think i can use it to point to a local file :

    function hook_fa_45() {

    $output = “<link rel=”stylesheet” href=”mywebsiteurl/css/font-awesome.min.css”/>”;
    echo $output;
    }
    add_action(‘wp_head’, ‘hook_fa_45’);

    But i also want to remove the head part where it go to the bootstrap cdn.
    I don’t want to have two link like this in the head :

    COPY CODE
    <<span class="start-tag">link</span> <span class="attribute-name">rel</span>='<a class="attribute-value">stylesheet</a>' <span class="attribute-name">id</span>='<a class="attribute-value">awesome-style-css</a>'  <span class="attribute-name">href</span>='<a class="attribute-value">//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css?ver=4.3.0</a>' <span class="attribute-name">type</span>='<a class="attribute-value">text/css</a>' <span class="attribute-name">media</span>='<a class="attribute-value">all</a>' />
    
    <<span class="start-tag">link</span> <span class="attribute-name">rel</span>='<a class="attribute-value">stylesheet</a>' <span class="attribute-name">id</span>='<a class="attribute-value">awesome-style-css</a>'  <span class="attribute-name">href="mywebsiteurl/css/font-awesome.min.css"/></span>' <span class="attribute-name">type</span>='<a class="attribute-value">text/css</a>' <span class="attribute-name">media</span>='<a class="attribute-value">all</a>' />
    
    How can i do that ?

    Thanks.
    Regards.

    #155142
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happyΒ to help you πŸ™‚

    #155143
     tonari
    Participant

    Thanks Laura πŸ™‚

    #155221
     Radu
    Moderator

    Hi,

    Please try this function

    COPY CODE
    
    function remove_asd_font_awesome() {
        wp_dequeue_style('font-awesome');
    }
    add_action('after_setup_theme', 'remove_asd_font_awesome');
    

    The function needs to be pasted in wp-content/themes/kleo-child/functions.php

    Let me know

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #155229
     tonari
    Participant

    Hi Radu,
    thanks πŸ™‚
    So i need to use both your code and mine ?
    To add the font-awesome.min.css from my local serveur and to remove the one from the CDN maxcdn.bootstrapcdn.com ?

    #155230
     Radu
    Moderator

    yes both

    Let me know

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #155239
     tonari
    Participant
    This reply has been set as private.
    #155246
     Radu
    Moderator

    You should what plugin load that to the website, if you de-activate all plugins this will continue to load ? if not activate plugins back one by one and check to see what load that thru the website

    Let me know

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #155247
     tonari
    Participant

    Great i found the plugin! I thought that was a kleo part sorry.
    I edited the plugin to load the local file, that’s ok thanks.
    Regards. πŸ™‚

    #155249
     Radu
    Moderator

    Great

    Have a nice day

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #155250
     tonari
    Participant

    Thanks you too Radu πŸ™‚

Viewing 11 posts - 1 through 11 (of 11 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?