首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >显示垃圾帖子而不是发布的帖子?

显示垃圾帖子而不是发布的帖子?
EN

Stack Overflow用户
提问于 2013-08-17 16:07:58
回答 1查看 2.1K关注 0票数 0

我想显示post_status=的帖子“垃圾”,而不是post_status=“发布”。简而言之,垃圾中的帖子应该显示在网站上。垃圾邮件在垃圾桶里有多长时间可用?任何帮助都将不胜感激。

index.php

代码语言:javascript
复制
<?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');  ?>

loop-coupon.php

代码语言:javascript
复制
<?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 &rsaquo;&rsaquo;', 'appthemes') ?></a></p>

                            <?php appthemes_after_post_content(); ?>    

                    </div> <!-- #item-panel -->


            </div> <!-- #item-frame -->


        </div>

    </div>

    <?php appthemes_after_post(); ?>
代码语言:javascript
复制
<?php appthemes_after_endwhile(); ?>
代码语言:javascript
复制
<?php appthemes_loop_else(); ?>

代码语言:javascript
复制
<h3><?php _e('Sorry, no coupons found', 'appthemes'); ?></h3>

`

EN

回答 1

Stack Overflow用户

发布于 2013-08-17 16:12:17

尝试在循环之前添加以下内容

代码语言:javascript
复制
query_posts($query_string. '&post_status=trash');
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18290795

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档