[WP] Recent Posts by Category Widget With Thumbnail

Functionsphp [php] function wpb_postsbycategory() { // the query $the_query = new WP_Query( array( ‘category_name’ => ‘announcements’, ‘posts_per_page’ => 10 ) ); // The Loop if ( $the_query->have_posts() ) { $string .= ‘<ul class="postsbycategory widget_recent_entries">’; while ( $the_query->have_posts() ) { $the_query->the_post(); if ( has_post_thumbnail() ) { $string .= ‘<li>’; $string .= ‘<a href="’ . get_the_permalink() .’"… Continue reading [WP] Recent Posts by Category Widget With Thumbnail