-
AuthorPosts
-
July 17, 2013 at 7:07 am #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'; }July 17, 2013 at 7:44 am #130000Yes – 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);
July 17, 2013 at 11:11 am #130001thanks 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'; }July 18, 2013 at 6:42 pm #130002Hi ,
Please read this post to see how to do this and why it isn’t working http://stackoverflow.com/a/9689686/1245478
Thanks,
Nick
July 19, 2013 at 1:15 pm #130003Dear 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?
July 20, 2013 at 7:25 pm #130004Hi,
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
July 21, 2013 at 12:21 pm #130005done, thanks!
-
AuthorPosts
- The topic ‘how to host entypo-fontello files on CDN?’ is closed to new replies.