php - Display current post on single template -


i have plugin automatically expires posts , changes it's post status "archive" on date.

we have archive section houses these posts. still want display data post gives page not found.

can alter query display post on single template?

i've tried following pulls in archive posts rather page you're on.

<?php $my_query = new wp_query('post_status=archive'); ?> <div>     <?php     if ($my_query->have_posts()) : while ($my_query->have_posts()) :         $my_query->the_post();         ?>         <ul>           <li>            <?php the_title(); ?>           </li>         </ul>     <?php endwhile; else: ?>         <div>         <ul>           <li><?php _e('no upcoming posts'); ?></li>         </ul>         </div>     <?php endif; ?> </div> 

post status allows users set workflow status post in wordpress.

there 8 default statuses wordpress uses. published, future, draft, pending, trash, auto-draft, , inherit.

a post may have new status if created , hasn't had previous status.

wordpress themes , plugins can define custom post statuses more complex websites. these statuses allows users organize posts in admin panel. useful sites multiple authors or complicated editorial process.

some things post status allows users work on article without publishing , saving draft. way can go later , finish it. allows users schedule posts gives post status of future, or make post private. attachments have post status of inherit. multi author blogs pending status can useful contributors can submit posts review prior publishing.

in case, have 100% sure archived posts status archive, otherwise wp query not work, check if plugin use set post type (the easy way directly in mysql database, table wp_posts or, if not have access mysql server via phpmyadmin - @ source code of plugin itself.).

edit: can try, testing, change wp query this:

$my_query = new wp_query( array( 'post_status' => array( 'pending', 'archive', 'publish' ) ) ); , see result?


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -