• 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/

    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

    (@piratescott)

    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.