大家好,所以我得到了这段代码来显示帖子,但相反或渲染帖子它呈现了关于我们页面可以任何人帮助。我正在运行WordPress 4.5.3
<?php get_header(); ?>
<?php
if(have_posts() ):
while(have_posts() ) : the_post();
the_title();
the_content();
endwhile;
endif;
?>
<?php get_footer(); ?>
答案 0 :(得分:0)
使用此:
$args = array(
'posts_per_page' => 10,
'offset' => 0,
'category' => '',
'category_name' => '',
'orderby' => 'date',
'order' => 'DESC',
'include' => '',
'exclude' => '',
'meta_key' => '',
'meta_value' => '',
'post_type' => 'post',
'post_mime_type' => '',
'post_parent' => '',
'author' => '',
'author_name' => '',
'post_status' => 'publish',
'suppress_filters' => true
);
query_posts($args);
if(have_posts()): the_post();
while(have_posts()): the_post();
?>
<h4> <?php the_title();?> </h4>
<?php endwhile;?>
<?php endif; ?>