2011-03-18 41 views

回答

0

尝试get_included_files()

它会列出都记录下来,但它会使用文件系统路径而不是URL

11

如果您使用的是儿童主题,其他解决方案将无法工作,它会为您提供父主题的目录。儿童主题使用:

<?php bloginfo('stylesheet_directory'); ?> 
+0

谢谢获取当前主题的url,我刚刚试了一下。 'stylesheet_directory'是如果您使用儿童主题的方式。 – mtchuente 2016-03-24 10:46:53

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

你可以试试下面的代码在WordPress

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

<?php echo get_template_directory_uri(); ?>