true, 'post_type' => 'post', 'posts_per_page' => 3, 'orderby' => 'ASC', ); if ( ! empty( $cat_id ) ) { $args['category__in'] = $cat_id; } break; default: break; } // Fetch posts. $posts = get_posts( $args ); if ( ! empty( $posts ) ) { $i = 1; foreach ( $posts as $key => $post ) { $post_id = $post->ID; $content[ $i ]['title'] = get_the_title( $post_id ); $content[ $i ]['post_url'] = get_permalink( $post_id ); $content[ $i ]['content'] = get_the_excerpt( $post_id ); $content[ $i ]['btn_txt'] = $options['front_page_blog_posts_read_more_btn_txt']; $content[ $i ]['btn_txt_url'] = $options['front_page_blog_posts_read_more_btn_txt_url']; $content[ $i ]['date'] = get_the_date( get_option( 'date_format' ), $post_id ); if ( has_post_thumbnail( $post_id ) ) { $featured_img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'business-center-blog' ); $img_array = $featured_img[0]; } else { $img_array = ''; } if ( isset( $img_array ) ) { $content[$i]['img_array'][0] = $img_array; } $i++; } } if ( ! empty( $content ) ) { $input = $content; } return $input; } endif; // Front Page Blog section content details. add_filter( 'business_center_filter_front_page_blog_section_details', 'business_center_get_front_page_blog_section_details' ); if ( ! function_exists( 'business_center_render_front_page_blog_section' ) ) : /** * Start front_page_blog section * * @return string Front Page Blog content * @since Business Center 1.0.0 * */ function business_center_render_front_page_blog_section( $content_details = array() ) { $options = business_center_get_theme_options(); if ( empty( $content_details ) ) { return; } ?>

<?php echo esc_attr( $content['title'] );?>