$offset, 'cat' => $cur_cat_id, 'posts_per_page' => $PAGE_SIZE, ); $query = new WP_Query($args); $ary_posts = []; while ($query->have_posts()) { $query->the_post(); $p = $post; $video_type = get_post_meta($p->ID,'video_type',true); $is_video_post = is_video_courses_video($video_type); $imgsrc = get_featured_imgsrc($p->ID, 'full'); if (!$imgsrc && $is_video_post) { $imgsrc = get_video_thumb_src_by_post_id($p->ID, LARGE_EXTERNAL_VIDEO_THUMBNAIL_SIZE); } $accessory = v2_display_pureboxV_cover_accessory($is_video_post ? 'video' : 'audio'); $ary_posts[] = array( 'title' => $p->post_title, 'summary' => $p->post_excerpt, 'imgsrc' => $imgsrc, 'link' => get_the_permalink($p->ID), 'editlink' => v2_editlink($p->ID), 'accessory' => $accessory ); } ?>