Support » Fixing WordPress » How to list unapproved post (loop)

  • Resolved Cristian Tacchi



    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…

Viewing 2 replies - 1 through 2 (of 2 total)
  • MichaelH


    //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().

    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


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to list unapproved post (loop)’ is closed to new replies.