我正在尝试定制“二十十”主题
这是标题的一部分。php:
<body <?php body_class(); ?>>
<div id="wrapper" class="hfeed">
<div id="header">
<img id="topL" src="images/img01.png"/> //this img I cannot insert !
</div><!-- #header -->
没有错误。简单地说,什么都没有发生。我正在尝试定制“二十十”主题
这是标题的一部分。php:
<body <?php body_class(); ?>>
<div id="wrapper" class="hfeed">
<div id="header">
<img id="topL" src="images/img01.png"/> //this img I cannot insert !
</div><!-- #header -->
没有错误。简单地说,什么都没有发生。不要使用相对URL。如果查看源文件,则可能要从中加载图像http://sitename.com/images/
当你想要的是http://sitename.com/wp-content/themes/themename/images/
. 假设图像位于与共享目录的文件夹中的主题目录中style.css
, 执行以下操作:
<img id="topL" src="<?php echo get_stylesheet_directory_uri(); ?>/images/img01.png"/>
http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri
我希望能够在主页上的jquery滑块中使用媒体库中的图片,以便其他人无需硬编码即可轻松更新图片。我在帖子上贴了一堆照片,并尝试了这个<?php $image_query = new WP_Query(array(\'name\'=>\'slider-images\')); while ( $image_query->have_posts() ) : $image_query->the_post(); $args = array( \'post_typ