Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何为Wordpress子主题中的图像提供正确的路径_Php_Wordpress - Fatal编程技术网

Php 如何为Wordpress子主题中的图像提供正确的路径

Php 如何为Wordpress子主题中的图像提供正确的路径,php,wordpress,Php,Wordpress,如何在我的wordpress子主题索引页面中提供样式背景图像路径。我试过了,但没用。我在这里给出了我的代码 <div class="item" style="background: url('<?php echo get_stylesheet_directory_uri(); ?>/images/about-banner.jpg')"> 使用下面的代码。 在view source中,您将获得什么路径? use below code. <div class="i

如何在我的wordpress子主题索引页面中提供样式背景图像路径。我试过了,但没用。我在这里给出了我的代码

<div class="item" style="background: url('<?php echo 
 get_stylesheet_directory_uri(); ?>/images/about-banner.jpg')">
使用下面的代码。

在view source中,您将获得什么路径?
use below code.
<div class="item" style="background: url('<?php echo 
 get_template_directory_uri(); ?>/images/about-banner.jpg')">