我尝试了很多php的组合来让wordpress输出$post->post_content作为格式化文本(与echo $post->post_content给我的原始格式化不同)。这个组合似乎是最有希望的,但它没有输出任何东西。有什么建议吗?
(就是这行代码:post_content); ?>)
(就是这行代码:post_content); ?>)
<?php query_posts('orderby=menu_order&order=asc&posts_per_page=-1&post_type=page&post_parent='.$post->ID); if(have_posts()) { while(have_posts()) { the_post(); ?>
<div class="page">
<?php
global $wpdb;
$subs = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent='$post->ID' AND post_type='page' AND post_status='publish'");
if($subs) {
?>
<div class="navi"></div>
<a class="naviNext"><img src="<?php bloginfo('template_url'); ?>/images/navi-next.png" alt="" /></a>
<div class="scrollable">
<div class="items">
<?php foreach($subs as $s) { ?>
<div class="item">
<h2><?php echo $s->post_title; ?></h2>
<?php $content = apply_filters('the_content', $s->post_content); echo $content; ?>
</div>
<?php } ?>
</div>
</div>
<?php } else { the_content(); } ?>
</div>
<?php } } wp_reset_query(); ?>