我正在使用wordpress,并且已经设置了几个自定义帖子类型。我需要知道如何从主外观中排除这些,以便自定义帖子类型不会在博客中显示。
发布于 2016-01-13 06:31:13
只需将'post_type‘=> 'home-post’替换为'post_type‘=> 'post’或删除该行,它将只拉出您的常规帖子
发布于 2016-01-13 17:54:39
this code use for fetch post type data
<?php
$args = array('post_type' => 'post','posts_per_page' => -1);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-content">
<?php the_content(); ?>
</div>
<?php endwhile;?>https://stackoverflow.com/questions/34730489
复制相似问题