我想你也想要一个图像标签:
if ( $colors && in_array( \'green\', $colors ) ) {
echo \'<div class="asdsf"><img src="\';
echo bloginfo(\'template_directory\') . \'/path/within/theme/to/img.png\';
echo \'"></div>\';
}
但最好用新的
get_stylesheet_directory_uri() 无论您是否使用子主题,它都会起作用。
if ( $colors && in_array( \'green\', $colors ) ) {
echo \'<div class="asdsf"><img src="\';
echo get_stylesheet_directory_uri() . \'/path/within/theme/to/img.png\';
echo \'"></div>\';
}