cristiantacchi
Member
Posted 1 month ago #
Hi,
I'm using wordpress (this time) as a new ideas posting system and i was thinking about to use the approve and unapprove posts system to mark them so i can list the approved ideas BUT.. i need to list the "not yet approved" or "unapproved ideas" too..
so...
how can i list the "not yet approved" or "unapproved" posts??
i need them so my ideas senders can see and check that your ideas were received and published...
<?php
//list all pending pages and posts
$types[0] = 'page';
$types[1] = 'post';
foreach ($types as $type) {
$args=array(
'post_type' => $type,
'post_status' => 'pending',
'showposts' => -1,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo 'List of pending: ' . $type .'(s)';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
} //if ($my_query)
} // foreach
wp_reset_query(); // Restore global post data stomped by the_post().
?>
cristiantacchi
Member
Posted 3 weeks ago #
Thanks a lottt!!! this really works as i need it..
i love you guys.. you make us strong!!
i love this whole comunity and thanks Michael for the answer
bye