【问题标题】:Image not displayed in WordPress.图像未显示在 WordPress 中。
【发布时间】:2014-05-21 03:23:03
【问题描述】:

我正在使用以下链接到functions.php 的内部图像选项。当点击提交按钮时,它会在 WordPress 管理员中崩溃。

<th scope="row">Image 1:</th> 
<td>
<input type="text" name="director_image1" value="<?php print get_option('director_image1'); ?>" />
<br/>
</td>
</tr>

我正在使用它来获取header.php 中的图像。

var theImage=<?php $image = get_option('director_image1');?>
<?php if( $image) : ?>
<?php echo "'".$image."';"; ?>
<?php endif; ?>

最后我在 javascript 文件中使用了 theImage 变量:

{
 src: theImage
 fade: 3000
 }

请帮我看看图片没有显示出来。

【问题讨论】:

  • 在该行中,您只有图像 src,但为了显示,您应该使用 标签。
  • @VishwaParekh 即使是这种情况,也不会导致服务器抛出错误,只会出现在控制台中的 javascript。
  • 是的,但在 html 部分从未使用 标签,因此图像仅使用 img 标签显示
  • @VishwaParekh 你们能帮帮我吗
  • 你能帮我吗@anand-solanki

标签: php wordpress image themes


【解决方案1】:

问题是我没有在 javascript 中必需的链接之后添加,。但我使用了;,它不应该在 javascript 中的链接 src 之后添加。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-05
    • 2012-01-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多