How to get the URL of the current topic?

The document says that

<?php bloginfo(‘template_url’);?>

but the output is just the theme folder, not the full URL.

NB my task is to get the php file url in the theme folder

+3
source share
4 answers

If you use a child theme, other solutions will not work, this will give you the parent theme directory. For children's themes, use this:

<?php bloginfo('stylesheet_directory'); ?>
+11
source

Try get_included_files ()

It will list everything, but will use the path to the file system, not the URL

0
source
<?php echo get_template_directory_uri(); ?>
0
source

You can try below code to get the current theme url in wordpress

<?php bloginfo(‘template_url’);?>

or

<?php echo get_template_directory_uri(); ?>
-1
source

All Articles