[resolved] How to list unapproved post (loop) (3 posts)

  1. Cristian Tacchi
    Posted 6 years ago #


    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..


    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...

  2. MichaelH
    Posted 6 years ago #

    //list all pending pages and posts
    $types[0] = 'page';
    $types[1] = 'post';
    foreach ($types as $type) {
        '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>
      } //if ($my_query)
    } // foreach
    wp_reset_query();  // Restore global post data stomped by the_post().
  3. Cristian Tacchi
    Posted 6 years 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


Topic Closed

This topic has been closed to new replies.

About this Topic