How to get url of current theme?
The do开发者_开发问答c says use that
<?php bloginfo(‘template_url’);?>
but the output is just a theme folder not the complete url.
NB my task is to get url of a php file in my theme folder
If you are using a child theme, the other solutions won't work, it'll give you the directory of the parent theme. For child themes use this:
<?php bloginfo('stylesheet_directory'); ?>
Try get_included_files()
It will list everything down but it will use the Filesystem path not the URL
<?php echo get_template_directory_uri(); ?>
You can try below code for getting current theme url in wordpress
<?php bloginfo(‘template_url’);?>
or
<?php echo get_template_directory_uri(); ?>
精彩评论