我想顯示post_status =「垃圾」的帖子,但不是post_status =「發佈」。簡而言之,垃圾中的帖子應該顯示在網站上。垃圾桶的垃圾桶可用多久?任何幫助,將不勝感激。顯示垃圾帖子而不是發佈的帖子?
的index.php
<?php
// show all coupons and setup pagination
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts(array(
'post_type' => APP_POST_TYPE,
'ignore_sticky_posts' => 1,
'paged' => $paged
));
?>
<?php get_template_part('loop', 'coupon'); ?>
環coupon.php
<?php while (have_posts()) : the_post(); ?>
<?php appthemes_before_post(); ?>
<div <?php post_class('item'); ?> id="post-<?php echo $post->ID; ?>">
<div class="item-holder">
<div class="item-frame">
<div class="store-holder">
<div class="store-image">
<a href="<?php echo appthemes_get_custom_taxonomy($post->ID, APP_TAX_STORE, 'slug'); ?>"><img height="89" width="110" src="<?php echo clpr_store_image($post->ID, APP_TAX_STORE, 'term_id', '110', null); ?>" alt="" /></a>
</div>
<div class="store-name">
<?php echo get_the_term_list($post->ID, APP_TAX_STORE, ' ', ', ', ''); ?>
</div>
</div>
<?php clpr_vote_box_badge($post->ID, $the_trans); ?>
<div class="item-panel">
<?php clpr_coupon_code_box(); ?>
<div class="clear"></div>
<?php appthemes_before_post_title(); ?>
<h1><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('View the "%s" coupon page', 'appthemes'), the_title_attribute('echo=0')); ?>"><?php if (mb_strlen(get_the_title()) >= 87) echo mb_substr(get_the_title(), 0, 87).'...'; else the_title(); ?></a></h1>
<?php appthemes_after_post_title(); ?>
<?php appthemes_before_post_content(); ?>
<p class="desc"><?php echo mb_substr(strip_tags($post->post_content), 0, 200).'... ';?><a class="more" href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('View the %s coupon page', 'appthemes'), the_title_attribute('echo=0')); ?>"><?php _e('more ››', 'appthemes') ?></a></p>
<?php appthemes_after_post_content(); ?>
</div> <!-- #item-panel -->
</div> <!-- #item-frame -->
</div>
</div>
<?php appthemes_after_post(); ?>
<?php appthemes_after_endwhile(); ?>
<?php appthemes_loop_else(); ?>
<h3><?php _e('Sorry, no coupons found', 'appthemes'); ?></h3>
`
嗯...設置他們發佈?他們只應該被設置爲垃圾,如果他們實際上是垃圾。 –
嗨@PatrickEvans,我不希望這些帖子因爲某些原因被編入索引。這就是爲什麼我想在創建後將它們垃圾並想要顯示垃圾帖子的原因。 –
因此,您希望發佈的帖子被垃圾和垃圾帖子發佈?請問爲什麼? – brasofilo