代码之家  ›  专栏  ›  技术社区  ›  user4324916

WordPress短代码抛出WYSIWYG html DIV外部

  •  1
  • user4324916  · 技术社区  · 11 年前

    我正试图通过Wordpress page WYSIWYG编辑器在我的页面中添加一个短代码 <div> 要素短代码确实出现并起作用。但不是呆在我的 <div> ,当页面呈现时 <div> 而是靠近页面顶部,引导页面内容。

    关于如何防止这种情况,有什么想法吗?

    我没有试图将其放在页面模板中。我试图将其放置在简单的自定义html中,放置在Pages WYSIWYG编辑器中。

    E、 g.我将短码放在页面中,如下所示:

    <div class="row">
    <p>some custom page html content</p>
    <div>
    <div class="row">
    [some_shortcode]
    </div>
    <div class="row">
    <p>some custom page html content</p>
    <div>
    <div class="row">
    <p>some custom page html content</p>
    <div>
    

    相反,它呈现如下:

    <!-- THE SHORTCODES HTML APPEARS HERE and Works but not where I wanted it. -->
    <!-- then the rest of the pages html content -->
    <div class="row">
    <p>some custom page html content</p>
    <div>
    <div class="row"><!-- no more shortcode-->
    </div>
    <div class="row">
    <p>some custom page html content</p>
    <div>
    <div class="row">
    <p>some custom page html content</p>
    <div>
    
    1 回复  |  直到 9 年前
        1
  •  5
  •   dojs    11 年前

    每当插件打印出其内容而不是使用返回时,就会出现此问题。

    有关更多信息,请参阅短代码API文档; http://codex.wordpress.org/Shortcode_API#Output