在Multisite中使用WordPress文本小部件,我需要找到一个图像。无法硬连接网站的URL,因为多个网站将使用相同的小部件。如何找到图像的相对路径?
答案 0 :(得分:0)
取决于他们所在的位置。
如果在您的主题中(或子主题,如果有效):
$url=get_stylesheet_directory_uri().'/path to your image in theme';
或插件
$url=get_site_url().'/wp-content/plugins/path to your image';
等!