Title: Listing these articles (small PHP Code)
Last modified: August 21, 2016

---

# Listing these articles (small PHP Code)

 *  [piratescott](https://wordpress.org/support/users/piratescott/)
 * (@piratescott)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/listing-these-articles/)
 * Ok so this code here displays the pending posts
 *     ```
       <?php
       $args= array(
           'post_type' => 'post',
           'post_status' => 'pending'
       );
       query_posts($args);
       ?>
       ```
   
 * How do I then post each result into a /ul /li and so on? as they now display 
   like this. [http://streakingpirates.com/pending/](http://streakingpirates.com/pending/)
 * would I do something like
    `<ul> <? =post /> </ul>` I’m no good with php so that’s
   an absolute guess

Viewing 1 replies (of 1 total)

 *  Thread Starter [piratescott](https://wordpress.org/support/users/piratescott/)
 * (@piratescott)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/listing-these-articles/#post-4930891)
 * OK so I got it working the way I want, now I want an image and a snippet of the
   posts content text with this
 *     ```
       <ul>
       <?php
       	$args = array( 'post_status' => 'pending', 'numberposts' => '10', 'tax_query' => array(
       			array(
       				'taxonomy' => 'post_format',
       				'field' => 'slug',
       				'terms' => 'post-format-aside',
       				'operator' => 'NOT IN'
       			),
       			array(
       				'taxonomy' => 'post_format',
       				'field' => 'slug',
       				'terms' => 'post-format-image',
        				'operator' => 'NOT IN'
       			)
       	) );
       	$recent_posts = wp_get_recent_posts( $args );
       	foreach( $recent_posts as $recent ){
       		echo '<li class="vote-title"><img src=""/><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' .   $recent["post_title"].'</a> </li>
       		<li>' . has_post_thumbnail($recent["get_the_post_thumbnail"]) . '</li> ';
       	}
       ?>
   
       </ul>
       ```
   
 * Thats the code but the section for get_the+post_thumbnail won’t show and I tried
   something similar for excerpt but that also wouldn’t show, whats the correct 
   format order for getting thumbnails and content text to show?

Viewing 1 replies (of 1 total)

The topic ‘Listing these articles (small PHP Code)’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [piratescott](https://wordpress.org/support/users/piratescott/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/listing-these-articles/#post-4930891)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
