Shortcode for latest -not expired- posts

Thanks, i got it now; indeed with meta_query. function my_recent_posts_shortcode( $atts ) { global $post; $currenttime = current_time(“mysql”); $args = array( ‘post_type’ => ‘post’, ‘meta_query’ => array( array( ‘key’ => ‘newsbox-date’, ‘value’ => $currenttime, ‘compare’ => ‘>’ ) ) ); $newsbox = new WP_Query( $args ); if ( $newsbox->have_posts() ) : $list=”<div class=”newsbox-posts”>”; while ( … Read more

WP Query – Post Thumbnail

the_post_thumbnail prints data to the screen immediately. It does not return a string that you can concatenate into your $out variable. Use get_the_post_thumbnail instead. Make sure you get the arguments right. They are different from the arguments for the_post_thumbnail. Should be something like: get_the_post_thumbnail(get_the_ID(),’thumbnail’);