How to get the url of current theme?

Picture of Woocoders
Woocoders
2nd September 2020

Getting the URL to the Current Theme

To grab the current theme directory’s URL, you can use the template_url parameter. This makes your WordPress themes more flexible so that when you change the domain name or use it in multiple domain names you don’t have to worry about changing anything that references the theme’s location. You can use this parameter a number of ways, such as for referencing custom external stylesheets, images, and JavaScript libraries that are inside the theme directory.

<?php bloginfo('template_url'); ?>

Share this post: