$data["postsCount"], 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'draft, publish, future, pending, private', 'suppress_filters' => true ); $recent_posts = wp_get_recent_posts( $args, ARRAY_A ); $recentList=""; foreach( $recent_posts as $recent ){ $img=wp_get_attachment_image_src( get_post_thumbnail_id($recent["ID"])); $recentList.= '
  • .$recent["post_title"].

    '.$recent["post_title"].'

    '.$recent["post_date"].'
  • '; } $TEMPLATE=str_replace("{recentList}",$recentList,$TEMPLATE); wp_reset_query(); //##############################Popular Posts############################################## wp_reset_query(); $post=query_posts('meta_key=wpb_post_views_count&orderby=>meta_value&numberposts='.$data["postsCount"]); if ( have_posts() ) : while ( have_posts() ) : the_post(); $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); $popularList.='
  • '.get_the_title().'

    '.get_the_title().'

    '.get_the_date().'
  • '; endwhile;endif; wp_reset_query(); $TEMPLATE=str_replace("{popularList}",$popularList,$TEMPLATE); //##############################Random Posts############################################## $post = query_posts('orderby=rand&numberposts='.$data["postsCount"]); if ( have_posts() ) : while ( have_posts() ) : the_post(); $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); $randomList.='
  • '.get_the_title().'

    '.get_the_title().'

    '.get_the_date().'
  • '; endwhile;endif; wp_reset_query(); $TEMPLATE=str_replace("{randomList}",$randomList,$TEMPLATE); return $TEMPLATE; } ?>