Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #26314

    Hi, to speed up the website, I just wonder if it is possible to host the entypo-fontello files on the CDN?

    @font-face {
    font-family: 'entypo-fontello'; font-weight: normal; font-style: normal;
    src: url('http://www.fujianshipbuilding.com/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/entypo-fontello.eot');
    src: url('http://www.fujianshipbuilding.com/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/entypo-fontello.eot?#iefix') format('embedded-opentype'),
    url('http://www.fujianshipbuilding.com/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/entypo-fontello.woff') format('woff'),
    url('http://c.fujianshipbuilding.com/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/entypo-fontello.ttf') format('truetype'),
    url('http://www.fujianshipbuilding.com/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/entypo-fontello.svg#fontello') format('svg');
    }

    .avia-font-entypo-fontello{ font-family: 'entypo-fontello'; }

    #130000

    Yes – this should be possible. Just copy/paste the font face code into a css file and change the url paths to your cdn. Obviously you need to make sure that the font files (located in /wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/) exist on the cdn server. Then open up wp-contentthemesenfoldconfig-templatebuilderavia-template-builderphptemplate-builder.class.php and delete/comment out:

    $output .= AviaHelper::load_font($element);

    #130001

    thanks and except to comment out the code as you mentioned, should I also load the css that that includes the code below? If so, how?

    @font-face {
    font-family: 'entypo-fontello'; font-weight: normal; font-style: normal;
    src: url('http://c.fujianshipbuilding.com/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/entypo-fontello.eot');
    src: url('http://c.fujianshipbuilding.com/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/entypo-fontello.eot?#iefix') format('embedded-opentype'),
    url('http://c.fujianshipbuilding.com/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/entypo-fontello.woff') format('woff'),
    url('http://c.fujianshipbuilding.com/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/entypo-fontello.ttf') format('truetype'),
    url('http://c.fujianshipbuilding.com/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/entypo-fontello.svg#fontello') format('svg');
    }

    .avia-font-entypo-fontello{ font-family: 'entypo-fontello'; }

    #130002

    Hi ,

    Please read this post to see how to do this and why it isn’t working http://stackoverflow.com/a/9689686/1245478

    Thanks,

    Nick

    #130003

    Dear Nick,

    Thanks and if I setup a css file (say font.css) for the font icon, how to add the font.css to wordpress? and except adding the css code to the wordpress, shall I also add “.avia-font-entypo-fontello{ font-family: ‘entypo-fontello’; }: to the wordpress?

    #130004

    Hi,

    You can do this to add additional css files. Lets say for this example you want to add a file called mycss.css. You should first upload it using ftp to your cdn or wherever your want to keep it , and copy the url of where your css file is located. Lets say http://cdn.your-domain.com/css/mycss.css is where you placed it. Now you can open up functions.php and find line 234 that looks like

    //register styles

    Then you will need to add the following to line 233, before the above line. dont forget to edit the url and replace my example with wherever your css file is located

    wp_register_style( 'mycss-custom',  "http:/cdn.your-domain.com/css/mycss.css", array(), '1', 'screen' );

    Then you will need to go to line 217 of the same file and add the code below to it. (You will see there are a few similar looking lines of code located there. Dont change the mycss-custom in the above or below code, only change the url

    wp_enqueue_script( 'mycss-custom' );

    Thanks,

    Nick

    #130005

    done, thanks!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘how to host entypo-fontello files on CDN?’ is closed to new replies.