'post', 'category__in' => $options['category_blog_two_multiple_category'], 'posts_per_page' => absint( $options['category_blog_two_count'] ) ); } break; case 'recent-posts': $args = array( 'post_type' => 'post', 'posts_per_page' => absint( $options['category_blog_two_count'] ) ); break; default: break; } if ( ! empty( $args ) ) { $posts = get_posts( $args ); $i = 1; foreach ( $posts as $key => $post ) { $page_id = $post->ID; $content[$i]['title'] = get_the_title( $page_id ); $content[$i]['url'] = get_the_permalink( $page_id ); $content[$i]['comment_count'] = get_comments_number( $page_id ); $content[$i]['date'] = get_the_date( 'M d, Y', $page_id ); $content[$i]['excerpt'] = academic_trim_content( 15, $post ); if ( has_post_thumbnail( $page_id ) ) { $img_array = wp_get_attachment_image_src( get_post_thumbnail_id( $page_id ), 'academic-category-image' ); } else { $img_array[0] = get_template_directory_uri().'/assets/uploads/no-featured-image-450x338.png'; } if ( isset( $img_array ) ) { $content[$i]['img_array'] = $img_array; } $i++; } } if ( ! empty( $content ) ) { $input = $content; } return $input; } endif; // Category Blog two content details. add_filter( 'academic_filter_category_blog_two_details', 'academic_get_category_blog_two_details' ); if ( ! function_exists( 'academic_render_category_blog_two' ) ) : /** * Start category blog two section * * @return string category blog two content * @since Academic 0.3 * */ function academic_render_category_blog_two( $content_details = array() ) { $options = academic_get_theme_options(); $category_blog_two_title = ! empty( $options['category_blog_two_title'] ) ? $options['category_blog_two_title'] : ''; $category_blog_two_layout = ! empty( $options['category_blog_two_layout'] ) ? $options['category_blog_two_layout'] : 4; $category_blog_two_dragable = ( $options['category_blog_two_dragable'] == true ) ? 'true' : 'false'; $category_blog_two_autoplay = ( $options['category_blog_two_autoplay'] == true ) ? 'true' : 'false'; ?>

|