Php 不确定如何将bloginfo引用添加到wordpress循环中的图像

Php 不确定如何将bloginfo引用添加到wordpress循环中的图像,php,wordpress,Php,Wordpress,我想使用wordpress循环中的引用图像,但不确定如何执行此操作。我的图像代码如下: <?php if (is_category('Events')) { echo '<img src="http://localhost/mmj/wp-content/themes/child-theme/img/live-banner.jpg" class="live-holder-img" />'; } else if (is_category('N

我想使用wordpress循环中的
引用图像,但不确定如何执行此操作。我的图像代码如下:

<?php
      if (is_category('Events')) {
        echo '<img src="http://localhost/mmj/wp-content/themes/child-theme/img/live-banner.jpg" class="live-holder-img" />';
      } else if (is_category('News')) {
       echo '<img src="http://localhost/mmj/wp-content/themes/child-theme/img/live-banner.jpg" class="live-holder-img" />';
      } else {
        echo '<img src="" class="default" />';
    } ?>


我宁愿替换
http://localhost/mmj/wp-content/themes/child-theme
但我知道我不能包括
您可以这样使用:

echo '<img src="'.get_bloginfo('stylesheet_directory').'/img/live-banner.jpg" class="live-holder-img" />';
echo 'Some strings here ' . get_bloginfo() . ' another strings';
echo 'Some strings here ' . get_bloginfo() . ' another strings';