【发布时间】:2014-09-09 05:25:25
【问题描述】:
我有一个 wordpress 页面,当我将文本放入 html/css 结构硬编码 stye 中时,它可以很好地适应,但是当我尝试通过 wordpress <?php echo the_content();?> 进行操作时,它会脱离结构。
这里是硬编码版本与 wordpress php 生成版本的对比
<div class="wrapper">
<p class="about-text">
hardcoded text stays in fine
</p>
</div>
<div class="wrapper">
<p class="about-text">
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<?php echo the_content(); ?>
<?php endwhile; ?>
<?php else: ?>
<?php endif; ?>
</p>
</div>
【问题讨论】:
-
你的内容一定有问题。
-
请删除所有这三个标签,这个问题应该放在css标签中。还有一件事,删除这个 php 代码并在此处添加生成的内容,或者更好的是为它创建 fiddle .. 这是链接 jsfiddle.net
-
请提供the_content生成的代码。