简体   繁体   中英

Wordpress: Display author's drafts and pending review posts in frontend

I need a way to make users view the drafts and pending review of the posts that he published . Without getting to the dashboard - which means from the frontend.

I want each to be in a different page than the other.

I tried this function in my custom template but unfortunately it didn't work.

<?php query_posts('&post_type=post&post_status=draft'); ?>

In your case, you need to call query_posts() with an array as argument. Try this:

<?php
$args= array(
    'post_type' => 'post',
    'post_status' => 'draft'
);
query_posts($args);
?>

Insert this just before the start of the Loop in your page template.

Source: WordPress › Support > How-To and Troubleshooting .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM