function wp_chore_error() {
$q = new WP_Query(
array( 'orderby' => 'date', 'posts_per_page' => '4')
);
$list ="";
while($q->have_posts()) : $q->the_post();
echo '<div class="item">';
$title=get_the_title();
if ( has_post_thumbnail() ) {
echo '<a class="single-image link-icon" href="' . get_permalink() . '">';
$list .=the_post_thumbnail(array(300,200),array('alt' =>$title));
echo '</a>';
}
echo '<h6 class="title"><a href="' . get_permalink() . '"><span>'.$title.'</span></a></h6>';
echo '<div class="entry-body">';
echo '<a class="button default color" href="' . get_permalink() . '">Read More</a>';
echo '</div>';
echo '</div>';
endwhile;
wp_reset_query();
return $list ;
}
add_action('wp_chore_error', 'add_post_page_error');