true, 'post_type' => 'post', 'p' => $id, ); break; default: break; } // Fetch posts. $posts = get_posts( $args ); if ( ! empty( $posts ) ) { foreach ( $posts as $key => $post ) { $post_id = $post->ID; $content['sub_title'] = get_the_title( $post_id ); $content['content'] = get_the_excerpt( $post_id ); $content['btn_url'] = get_permalink( $post_id ); $content['btn_txt'] = $options['call_to_action_btn_txt']; $img_array = null; if ( has_post_thumbnail( $post_id ) ) { $bg_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); $content['bg_image'] = $bg_image[0]; } else { $content['bg_image'] = ''; } } } if ( ! empty( $content ) ) { $input = $content; } return $input; } endif; // Call To Action section content details. add_filter( 'business_center_filter_call_to_action_section_details', 'business_center_get_call_to_action_section_details' ); if ( ! function_exists( 'business_center_render_call_to_action_section' ) ) : /** * Start call_to_action section * * @return string Call To Action content * @since Business Center 1.0.0 * */ function business_center_render_call_to_action_section( $content_details = array() ) { $options = business_center_get_theme_options(); if ( empty( $content_details ) ) { return; } $bg_image = ( ! empty( $content_details['bg_image'] ) ) ? $content_details['bg_image'] : ''; ?>