Change template_directory to use a CDN path

Posted on 16th September, 2015 328 Comments

So you’ve created your theme and you would like to switch to using a CDN for your scripts and CSS…

Add this to your functions.php and replace the YOUR-SITE with the urls of the website and the CDN.

add_filter( 'template_directory_uri', function( $template_dir_uri ){
return str_replace( 'http://www.YOUR-SITE.co.uk/', '//cdn.YOUR-SITE.co.uk/', $template_dir_uri );
});

Comments

To preserve code added to a comment you can wrap your code in short tags
by using [square brackets]:

  1. PHP use - [php] <?php code here ?> [/php]
  2. CSS use - [css] #code-here {} [/css]
  3. HTML use - [html] <div> code here </div> [/html]
  4. JS use - [js] $(".codeHere") [/js]

JamesVen

20th, Oct, 20

be a outstrip urgently fitted the next legit and Mawkishness [url=https://ciamedusa.com/]cialis from canada[/url] Owekek qfiwwt cialis effective buying cialis online safely

JamesVen

21st, Oct, 20

propagation: To delays the device go along an allergist of. [url=https://ciamedusa.com/#]generic cialis india[/url] and misinterpreting them its compromises to position statement

카지노사이트

07th, Jan, 21

Thanks again for stopping by, Solanski. Hope you’re having a great weekend.
You know, “trying not to sound like an idiot” is a pretty decent approach to commenting. If only every commenter took that approach! Haha.
카지노사이트

hey

13th, Jan, 21

Taxi moto line
128 Rue la Boétie
75008 Paris
+33 6 51 612 712  

Taxi moto paris

Pretty! This was an incredibly wonderful article.
Thank you for providing these details.

vreyrolinomit

17th, Jan, 21

Hmm it appears like your website ate my first comment (it was super long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog. I as well am an aspiring blog writer but I’m still new to everything. Do you have any recommendations for beginner blog writers? I’d certainly appreciate it.

Lcxeloks

21st, Jan, 21

viagracanada viagra canada pfizer viagra [url=http://genqpviag.com/]where can i buy viagra in ireland[/url] ’

KbbtBoth

24th, Jan, 21

cheap. generic cialisis Lotensin best price for cialis 20 mg [url=https://xz-pharmacyonline.com]canadian drugstore[/url] ’

froleprotrem

28th, Jan, 21

I have been checking out some of your posts and i can claim clever stuff. I will surely bookmark your site.

부산달리기

03rd, Feb, 21

I?m amazed, I have to claim. Truly rar부산달리기
ly do I come across a blog that?s both educative as well as amusing, and also let me inform you, you have actually hit the nail on the head. Your suggestion is exceptional; the concern is something that not nearly enough individuals are speaking smartly about. I am very happy that I came across this in my look for something connecting to this.

froleprotrem

05th, Feb, 21

Hiya very cool web site!! Guy .. Excellent .. Superb .. I will bookmark your site and take the feeds additionally?KI’m happy to search out a lot of useful information here in the publish, we’d like develop more strategies in this regard, thanks for sharing. . . . . .

antivirüslere yakalanmayan php shell

08th, Feb, 21

When I originally commented I clicked the “Notify me when new comments are added”
checkbox and now each time a comment is added I get several emails with the same comment.
Is there any way you can remove me from that service?
Thanks!

vreyro linomit

08th, Feb, 21

Hello! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly? My site looks weird when viewing from my iphone. I’m trying to find a theme or plugin that might be able to correct this issue. If you have any recommendations, please share. Thanks!

Ybacroli

13th, Feb, 21

texas department of health & – cialis generic Aagilvz
does cialis for women work
cialis price compared to viagra: [url=https://www.withoutbro.com/]viagra for sale[/url]

Google

26th, Feb, 21

Google

Here are some links to web pages that we link to due to the fact we think they’re worth visiting.

Google

18th, Mar, 21

Google

Please check out the web sites we follow, including this 1, because it represents our picks in the web.

buy herbal incense online

27th, Mar, 21

buy herbal incense online

[…]please take a look at the internet sites we stick to, like this one particular, as it represents our picks in the web[…]

thc vape juice

31st, Mar, 21

thc vape juice

[…]The facts mentioned within the post are several of the most effective accessible […]

canada vs usa

01st, Apr, 21

canada vs usa

[…]below you will uncover the link to some web-sites that we assume you must visit[…]

virtual card buy

05th, Apr, 21

virtual card buy

[…]we came across a cool website that you could possibly take pleasure in. Take a appear should you want[…]

Mario kart Arcade Gp Dx

06th, Apr, 21

Mario kart Arcade Gp Dx

[…]check below, are some totally unrelated web sites to ours, on the other hand, they’re most trustworthy sources that we use[…]

Copper ring

06th, Apr, 21

Copper ring

[…]here are some links to internet sites that we link to due to the fact we consider they may be really worth visiting[…]

web landing page

08th, Apr, 21

web landing page

[…]check beneath, are some entirely unrelated internet sites to ours, nonetheless, they may be most trustworthy sources that we use[…]

buy delta 8 THC

09th, Apr, 21

buy delta 8 THC

[…]below you will obtain the link to some web pages that we consider you’ll want to visit[…]

where to buy delta 8

09th, Apr, 21

where to buy delta 8

[…]that is the finish of this report. Right here you’ll come across some internet sites that we believe you’ll appreciate, just click the hyperlinks over[…]

DEXACORTYLE FOR SALE

11th, Apr, 21

DEXACORTYLE FOR SALE

[…]Wonderful story, reckoned we could combine a handful of unrelated information, nevertheless definitely worth taking a search, whoa did one master about Mid East has got extra problerms also […]

cheap cocaine for sale

11th, Apr, 21

cheap cocaine for sale

[…]very couple of web sites that transpire to be in depth below, from our point of view are undoubtedly nicely really worth checking out[…]

우리카지노

13th, Apr, 21

우리카지노

[…]just beneath, are numerous absolutely not related sites to ours, having said that, they may be surely really worth going over[…]

코인카지노

13th, Apr, 21

코인카지노

[…]please take a look at the web-sites we adhere to, including this one particular, because it represents our picks in the web[…]

Cryptocurrency

16th, Apr, 21

Cryptocurrency

[…]Every after in a even though we choose blogs that we read. Listed beneath are the most up-to-date web-sites that we choose […]

Vidalista 40mg

16th, Apr, 21

Vidalista 40mg

[…]just beneath, are quite a few entirely not associated internet sites to ours, nevertheless, they are surely really worth going over[…]

buy guns online

17th, Apr, 21

buy guns online

[…]here are some hyperlinks to websites that we link to simply because we think they are worth visiting[…]

End Of Tenancy Cleaning UK

18th, Apr, 21

End Of Tenancy Cleaning UK

[…]Wonderful story, reckoned we could combine a handful of unrelated data, nonetheless actually really worth taking a look, whoa did one particular learn about Mid East has got additional problerms also […]

Guns for sale

19th, Apr, 21

Guns for sale

[…]check beneath, are some absolutely unrelated internet sites to ours, on the other hand, they may be most trustworthy sources that we use[…]

container homes for sale

20th, Apr, 21

container homes for sale

[…]check beneath, are some completely unrelated websites to ours, on the other hand, they may be most trustworthy sources that we use[…]

Buy Weed Online

22nd, Apr, 21

Buy Weed Online

[…]here are some links to internet sites that we link to because we consider they are worth visiting[…]

buy Instagram followers

23rd, Apr, 21

buy Instagram followers

[…]Every after in a whilst we choose blogs that we read. Listed beneath would be the newest web-sites that we pick out […]

Lizeth Skipper

25th, Apr, 21

Have you ever heard of second life (sl for short). It is essentially a video game where you can do anything you want. SL is literally my second life (pun intended lol). If you would like to see more you can see these sl articles and blogs

Rubber Gloves

26th, Apr, 21

Rubber Gloves

[…]we came across a cool website that you may well take pleasure in. Take a search in case you want[…]

Thanh Tamez

26th, Apr, 21

Have you ever heard of second life (sl for short). It is essentially a video game where you can do anything you want. SL is literally my second life (pun intended lol). If you want to see more you can see these second life authors and blogs

online cbd shop

27th, Apr, 21

online cbd shop

[…]we prefer to honor many other internet web-sites around the internet, even though they aren’t linked to us, by linking to them. Under are some webpages worth checking out[…]

how to make dmt

28th, Apr, 21

how to make dmt

[…]here are some hyperlinks to web sites that we link to simply because we believe they are worth visiting[…]

yamaha tenere 700

28th, Apr, 21

yamaha tenere 700

[…]we prefer to honor quite a few other internet websites on the net, even when they aren’t linked to us, by linking to them. Under are some webpages really worth checking out[…]

click

28th, Apr, 21

Greetings! Very helpful advice on this article! It is the little changes that make the biggest changes. Thanks a lot for sharing!

bespokecarpentrylondon.co.uk

28th, Apr, 21

I simply couldn’t leave your website prior to suggesting that I really loved the usual info an individual supply to your visitors? Is going to be back incessantly in order to inspect new posts

visit

28th, Apr, 21

I would like to thnkx for the efforts you have put in writing this blog. I am hoping the same high-grade blog post from you in the upcoming as well. In fact your creative writing abilities has inspired me to get my own blog now. Really the blogging is spreading its wings quickly. Your write up is a good example of it.

dexedrine for sale eu

28th, Apr, 21

dexedrine for sale eu

[…]we like to honor lots of other world-wide-web sites on the internet, even when they aren’t linked to us, by linking to them. Underneath are some webpages really worth checking out[…]

trueadvicefinancialservices.co.uk

29th, Apr, 21

Hiya, I’m really glad I have found this information. Nowadays bloggers publish just about gossips and net and this is really annoying. A good site with exciting content, this is what I need. Thanks for keeping this website, I will be visiting it. Do you do newsletters? Can not find it.

wrong fuel in car

29th, Apr, 21

Great article and straight to the point. I am not sure if this is really the best place to ask but do you people have any thoughts on where to hire some professional writers? Thx 🙂

crossdress cams

29th, Apr, 21

crossdress cams

[…]very handful of web-sites that happen to become detailed below, from our point of view are undoubtedly nicely really worth checking out[…]

aka ms remote connect

30th, Apr, 21

aka ms remote connect

[…]Every once in a when we opt for blogs that we study. Listed below are the latest internet sites that we select […]

SEO Nanaimo

30th, Apr, 21

SEO Nanaimo

[…]please pay a visit to the websites we adhere to, which includes this one particular, as it represents our picks from the web[…]

burnaby moving

30th, Apr, 21

burnaby moving

[…]here are some hyperlinks to sites that we link to simply because we assume they’re worth visiting[…]

forex affiliate program

30th, Apr, 21

Hello There. I discovered your blog the use of msn. This is a very well written article. I will be sure to bookmark it and return to learn more of your useful information. Thank you for the post. I’ll definitely comeback.

20 cialis

02nd, May, 21

Greetings! Quick question that’s totally
off topic. Do you know how to make your site
mobile friendly? My blog looks weird when viewing from my iphone4.
I’m trying to find a theme or plugin that might be able to
resolve this issue. If you have any recommendations, please share.

Appreciate it! https://cialis.cleckleyfloors.com/tadalafil

link

03rd, May, 21

Some truly interesting details you have written.Assisted me a lot, just what I was searching for : D.

PHANTOM COOKIES FRIENDLY FARMS

03rd, May, 21

PHANTOM COOKIES FRIENDLY FARMS

[…]Wonderful story, reckoned we could combine several unrelated information, nevertheless actually worth taking a appear, whoa did one particular master about Mid East has got far more problerms also […]

Javiertax

04th, May, 21

tinder date , what is tinder
[url=”http://tinderentrar.com/?”]how to use tinder [/url]

eur to usd

04th, May, 21

obviously like your web-site but you need to take a look at the spelling on several of your posts. Many of them are rife with spelling problems and I to find it very bothersome to inform the reality on the other hand I will certainly come again again.

buy weed

05th, May, 21

buy weed

[…]that will be the finish of this post. Here you’ll uncover some web-sites that we believe you’ll appreciate, just click the hyperlinks over[…]

tubidy mp3

05th, May, 21

tubidy mp3

[…]Wonderful story, reckoned we could combine a couple of unrelated data, nevertheless truly worth taking a search, whoa did one master about Mid East has got more problerms as well […]

Website

07th, May, 21

Website

[…]that may be the finish of this write-up. Here you’ll discover some web sites that we feel you’ll enjoy, just click the hyperlinks over[…]

adam and eve

09th, May, 21

adam and eve

[…]that is the end of this write-up. Right here you will locate some internet sites that we assume you’ll appreciate, just click the hyperlinks over[…]

bitcoin wallet card

11th, May, 21

bitcoin wallet card

[…]please stop by the sites we follow, like this one particular, as it represents our picks from the web[…]

Javiertax

11th, May, 21

browse tinder for free , browse tinder for free
[url=http://tinderentrar.com/]http://tinderentrar.com/[/url]

CRUISE HOLIDAYS

11th, May, 21

CRUISE HOLIDAYS

[…]just beneath, are several totally not related web pages to ours, even so, they’re surely really worth going over[…]

learn more

11th, May, 21

learn more

[…]we like to honor lots of other net websites around the net, even if they aren’t linked to us, by linking to them. Under are some webpages really worth checking out[…]

Web design Los Angeles

13th, May, 21

Web design Los Angeles

[…]just beneath, are several absolutely not associated web sites to ours, nevertheless, they may be surely worth going over[…]

from canada

15th, May, 21

from canada

[…]below you will obtain the link to some sites that we consider it is best to visit[…]

girl testing sex toys

16th, May, 21

girl testing sex toys

[…]check below, are some completely unrelated internet sites to ours, having said that, they’re most trustworthy sources that we use[…]

Vortex Red Dot

16th, May, 21

Vortex Red Dot

[…]that could be the end of this post. Here you will locate some websites that we feel you will enjoy, just click the links over[…]

gas fireplace

17th, May, 21

gas fireplace

[…]although sites we backlink to below are considerably not related to ours, we really feel they’re actually really worth a go by way of, so have a look[…]

Architectural design

20th, May, 21

Architectural design

[…]always a massive fan of linking to bloggers that I love but really don’t get lots of link adore from[…]

https://londoncitylocksmiths.co.uk/

23rd, May, 21

Hi, Neat post. There is a problem together with your web site in internet explorer, may check this?K IE nonetheless is the marketplace chief and a large section of other folks will miss your great writing due to this problem.

best sex toys

24th, May, 21

best sex toys

[…]here are some hyperlinks to websites that we link to mainly because we consider they’re really worth visiting[…]

Best Dildo

24th, May, 21

Best Dildo

[…]The info talked about inside the post are several of the ideal obtainable […]

umraniye citir escort

24th, May, 21

umraniye citir escort

[…]please check out the sites we follow, such as this 1, because it represents our picks through the web[…]

bondage sex toys

24th, May, 21

bondage sex toys

[…]very few web-sites that happen to become in depth below, from our point of view are undoubtedly well worth checking out[…]

vibrator

25th, May, 21

vibrator

[…]The information and facts mentioned within the post are a few of the most beneficial readily available […]

มาร์คหน้า

26th, May, 21

Howdy! I know this is kinda off topic but I was wondering if you knew where I could locate a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one? Thanks a lot!

slotxo

26th, May, 21

I?¦ve recently started a web site, the info you offer on this web site has helped me greatly. Thank you for all of your time & work.

deuterium oxide for sale

26th, May, 21

deuterium oxide for sale

[…]Every as soon as in a although we decide on blogs that we study. Listed below are the most up-to-date websites that we decide on […]

best squirting dildo

27th, May, 21

best squirting dildo

[…]the time to study or take a look at the content material or internet sites we have linked to beneath the[…]

vibrating thrusting dildo

27th, May, 21

vibrating thrusting dildo

[…]Every as soon as in a though we decide on blogs that we study. Listed below would be the most current sites that we opt for […]

phone repair shops near me

27th, May, 21

phone repair shops near me

[…]that is the end of this post. Here you’ll obtain some internet sites that we believe you will enjoy, just click the hyperlinks over[…]

porn

28th, May, 21

porn

[…]usually posts some very fascinating stuff like this. If you are new to this site[…]

K98 mauser for sale

29th, May, 21

K98 mauser for sale

[…]that would be the finish of this post. Here you’ll discover some web sites that we feel you’ll value, just click the links over[…]

anal butt plug

30th, May, 21

anal butt plug

[…]always a huge fan of linking to bloggers that I appreciate but do not get a whole lot of link like from[…]

first sex toys

30th, May, 21

first sex toys

[…]Every after inside a though we opt for blogs that we study. Listed beneath are the most recent web-sites that we select […]

everyday life of a sex toy reviewer

30th, May, 21

everyday life of a sex toy reviewer

[…]we like to honor quite a few other world-wide-web internet sites on the net, even when they aren’t linked to us, by linking to them. Underneath are some webpages worth checking out[…]

pharmacyincanada.net

31st, May, 21

pharmacyincanada.net

[…]we prefer to honor lots of other internet web pages on the internet, even when they aren’t linked to us, by linking to them. Below are some webpages worth checking out[…]

SEO対策東京

31st, May, 21

hello!,I really like your writing very much! percentage we keep up a correspondence more approximately your post on AOL? I require an expert on this space to solve my problem. Maybe that is you! Taking a look forward to peer you.

ar 15 rifle for sale

01st, Jun, 21

ar 15 rifle for sale

[…]Wonderful story, reckoned we could combine a couple of unrelated data, nonetheless actually worth taking a appear, whoa did one understand about Mid East has got more problerms at the same time […]

escort maltepe

01st, Jun, 21

escort maltepe

[…]check beneath, are some completely unrelated websites to ours, having said that, they’re most trustworthy sources that we use[…]

canadian website

03rd, Jun, 21

canadian website

[…]usually posts some incredibly interesting stuff like this. If you’re new to this site[…]

healthplanscanada.com

03rd, Jun, 21

healthplanscanada.com

[…]we like to honor numerous other net internet sites on the net, even though they aren’t linked to us, by linking to them. Below are some webpages worth checking out[…]

slot online

03rd, Jun, 21

slot online

[…]the time to study or stop by the content material or internet sites we have linked to below the[…]

comprar viagra fiable

04th, Jun, 21

poppers et viagra [url=https://franceviag.com/#]forum achat viagra [/url] where can you buy viagra pills combien de temps dure effet viagra

electric motorcyles canada

04th, Jun, 21

electric motorcyles canada

[…]just beneath, are many entirely not related websites to ours, on the other hand, they are surely really worth going over[…]

odzysiwanie danych z telefonu iPhone Poznań

05th, Jun, 21

Hey there just wanted to give you a quick heads up and let you know a few of the images aren’t loading correctly. I’m not sure why but I think its a linking issue. I’ve tried it in two different browsers and both show the same outcome.

kratom powder

06th, Jun, 21

kratom powder

[…]usually posts some quite fascinating stuff like this. If you are new to this site[…]

sex toy reviews

06th, Jun, 21

sex toy reviews

[…]we prefer to honor a lot of other internet web pages on the web, even if they aren’t linked to us, by linking to them. Beneath are some webpages worth checking out[…]

Beauty Salon In Irvine

07th, Jun, 21

Beauty Salon In Irvine

[…]although internet websites we backlink to below are considerably not related to ours, we feel they may be really really worth a go through, so have a look[…]

male prostate toy

11th, Jun, 21

male prostate toy

[…]very handful of web sites that transpire to be in depth beneath, from our point of view are undoubtedly effectively worth checking out[…]

dealoftheday

12th, Jun, 21

Some times its a pain in the ass to read what blog owners wrote but this internet site is really user friendly! .

flashbrosales

12th, Jun, 21

I believe this is among the so much important information for me. And i am satisfied studying your article. However want to statement on few general things, The web site taste is wonderful, the articles is actually great : D. Just right activity, cheers

Guns for Sale Near Me

16th, Jun, 21

Guns for Sale Near Me

[…]check below, are some absolutely unrelated internet websites to ours, having said that, they are most trustworthy sources that we use[…]

Solmax Global Login

16th, Jun, 21

Solmax Global Login

[…]we like to honor quite a few other world-wide-web web sites around the web, even if they aren’t linked to us, by linking to them. Under are some webpages really worth checking out[…]

where to buy kratom

21st, Jun, 21

where to buy kratom

[…]Every the moment inside a while we select blogs that we read. Listed below are the most up-to-date websites that we pick […]

buy real Instagram likes

21st, Jun, 21

buy real Instagram likes

[…]Wonderful story, reckoned we could combine some unrelated information, nonetheless seriously really worth taking a search, whoa did one understand about Mid East has got much more problerms at the same time […]

best delta 8

22nd, Jun, 21

best delta 8

[…]although internet sites we backlink to below are considerably not related to ours, we feel they are truly really worth a go by, so possess a look[…]

best delta 8 THC vape cartridges

22nd, Jun, 21

best delta 8 THC vape cartridges

[…]Wonderful story, reckoned we could combine a handful of unrelated data, nevertheless genuinely really worth taking a search, whoa did one discover about Mid East has got additional problerms too […]

best strap on

28th, Jun, 21

best strap on

[…]we prefer to honor quite a few other internet web sites on the net, even if they aren’t linked to us, by linking to them. Underneath are some webpages worth checking out[…]

best delta 8 gummies

29th, Jun, 21

best delta 8 gummies

[…]Wonderful story, reckoned we could combine a handful of unrelated data, nevertheless really really worth taking a search, whoa did 1 study about Mid East has got much more problerms as well […]

best cbd gummies

29th, Jun, 21

best cbd gummies

[…]here are some hyperlinks to sites that we link to simply because we feel they may be worth visiting[…]

mortgages for first time buyers

01st, Jul, 21

I intended to draft you the tiny word to be able to thank you very much over again relating to the marvelous things you have contributed on this website. It has been certainly incredibly generous with you to convey unreservedly all numerous people could possibly have supplied for an ebook in order to make some money on their own, especially seeing that you might have tried it in the event you considered necessary. These points additionally acted to be the fantastic way to understand that other people online have a similar dreams just as my own to find out much more regarding this issue. Certainly there are numerous more fun periods up front for individuals that scan through your site.

clit massager

03rd, Jul, 21

clit massager

[…]we came across a cool site that you could possibly love. Take a look when you want[…]

weed near me

05th, Jul, 21

weed near me

[…]below you will obtain the link to some web sites that we assume you’ll want to visit[…]

SF Examiner

05th, Jul, 21

SF Examiner

[…]the time to read or go to the subject material or web pages we have linked to below the[…]

albino a+

06th, Jul, 21

albino a+

[…]Wonderful story, reckoned we could combine several unrelated data, nonetheless truly worth taking a look, whoa did 1 learn about Mid East has got more problerms as well […]

Ruger Pistols

06th, Jul, 21

Ruger Pistols

[…]please visit the web-sites we follow, which includes this one particular, as it represents our picks from the web[…]

more info

16th, Jul, 21

I really appreciate this post. I’ve been looking everywhere for this! Thank goodness I found it on Bing. You’ve made my day! Thank you again!

click here

16th, Jul, 21

Hello.This post was really motivating, particularly because I was searching for thoughts on this matter last Sunday.

Leave a Comment

To preserve code added to a comment you can wrap your code in short tags
by using [square brackets]:

  1. PHP use - [php] <?php code here ?> [/php]
  2. CSS use - [css] #code-here {} [/css]
  3. HTML use - [html] <div> code here </div> [/html]
  4. JS use - [js] $(".codeHere") [/js]