【问题标题】:img path in wordpress text editorwordpress 文本编辑器中的 img 路径
【发布时间】:2014-03-04 09:36:31
【问题描述】:

我目前正在尝试将 html 主题插入 wordpress。为此,我在文本编辑器中复制粘贴 HTML,但它给我的 img 路径带来了一个奇怪的问题......

例如:

<img src="<?php bloginfo('stylesheet_directory'); ?>/_include/img/slider-images/1.jpg" alt="Image" data-fullwidthcentering="on">

当我在 Chrome 上检查源代码时,src 似乎没有关闭,但我找不到原因。右引号显示为 ” ;代替 ” 可能是编码问题吗?我没有解决方案...

ps:我正在使用

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

在我的function.php中

有什么线索吗?

【问题讨论】:

    标签: php html wordpress image path


    【解决方案1】:

    您不能在内容编辑器中使用 PHP,只需写下图片的完整路径即可。

    <img src="/css/_include/img/slider-images/1.jpg" alt="Image" data-fullwidthcentering="on">
    

    【讨论】:

      猜你喜欢
      • 2023-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-08
      • 2015-06-05
      • 1970-01-01
      • 2021-08-29
      • 1970-01-01
      相关资源
      最近更新 更多