1

I'm trying to put a shortcode within my page via the Wordpress Page WYSIWYG editor in a specific <div> element. The shortcode does appear and works. But instead of staying within my <div>, when the page renders it does not render in the <div> but instead near the top of my page, leading the pages content instead.

Any ideas as to how to prevent this?

I am not trying to put it within the pages template. I'm trying to place it within simple custom html, laid out within the Pages WYSIWYG editor.

E.g. I'm placing the shortcode with in the page like so:

<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>

Instead it renders like this:

<!-- 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>
4

1 回答 1

5

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

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

于 2015-03-06T22:42:20.800 回答