CDN on PHP! How?😱 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

CDN on PHP! How?😱

Hey guys! I wanna ask a question! I create a template on html and I wanna change it to php and make it dynamic. I already did that. I could define my stylesheets with <?php echo get_template_directory_uri(); ?>/ for files but I don't know how can I use CDN on php? I mean I wanna use owl carousel and I used CDN on html. Is there any code which can define CDN?

24th Nov 2023, 4:52 PM
Sara Hashemi
Sara Hashemi - avatar
2 Answers
+ 3
get_template_directory_uri() is a WordPress function to retrieve the current template URI. So that's where your stylesheet should be. I recommend using cloudflare or bunny.net as a CDN for your WordPress sites. They can also be used together. Cloudflare has a completely free option and provides awesome security features. https://www.cloudflare.com/ https://bunny.net/
25th Nov 2023, 9:31 AM
Keith
Keith - avatar
+ 3
Keith thank youuu🫶🏻
26th Nov 2023, 6:35 PM
Sara Hashemi
Sara Hashemi - avatar