adsense

How to List Posts That Are Pending Review in WordPress





1. Log in to the WordPress dashboard, go to 'Appearance' and click the 'Editor' link. Locate the template where you want to add the list of pending posts and click its link to load the file in the theme editor.
2. Create a new query of the WordPress database:$query = new WP_Query();Use any name for the variable; 'query' works well but any name will work.

3. Add parameters for the query between the parentheses. Set 'post_status' to 'pending' to get pending posts. Use 'ignore_sticky_posts=1' to keep sticky posts -- posts set to always appear at the top of the blog index -- out of your list:$query = new WP_Query('post_status=pendingignore_sticky_posts=1');
4. Start a 'While' loop to display posts returned by the query:while ($query->have_posts()) : $query->the_post();
5. Close the block of PHP code with an ending delimeter tag -- ?> -- and add this code to output a link to each pending post:
' title='
'>



6. Open a new pair of PHP delimeter tags and write the next block of PHP code between them. Close your 'While' loop with 'endwhile' and use 'wp_reset_postdata()' to clear the query.

Comments

0 Responses to "How to List Posts That Are Pending Review in WordPress"

Post a Comment

Popular Posts

About