'; } } add_action( 'wp_head', 'safar_lite_pingback_header' ); /** * Function to get Sections */ function safar_lite_get_sections() { $sections = array( 'featured-slider', 'featured-posts' ); $enabled_section = array(); foreach ( $sections as $section ){ if (false == safar_lite_get_option('disable_'.$section.'_section')){ $enabled_section[] = array( 'id' => $section, 'menu_text' => esc_html( safar_lite_get_option('' . $section . '_menu_title','') ), ); } } return $enabled_section; } if ( ! function_exists( 'safar_lite_the_excerpt' ) ) : /** * Generate excerpt. * * @since 1.0.0 * * @param int $length Excerpt length in words. * @param WP_Post $post_obj WP_Post instance (Optional). * @return string Excerpt. */ function safar_lite_the_excerpt( $length = 0, $post_obj = null ) { global $post; if ( is_null( $post_obj ) ) { $post_obj = $post; } $length = absint( $length ); if ( 0 === $length ) { return; } $source_content = $post_obj->post_content; if ( ! empty( $post_obj->post_excerpt ) ) { $source_content = $post_obj->post_excerpt; } $source_content = preg_replace( '`\[[^\]]*\]`', '', $source_content ); $trimmed_content = wp_trim_words( $source_content, $length, '…' ); return $trimmed_content; } endif; // Customizer Control if (class_exists('WP_Customize_Control') && ! class_exists( 'safar_lite_Image_Radio_Control' ) ) { /** * Customize sidebar layout control. */ class safar_lite_Image_Radio_Control extends WP_Customize_Control { public function render_content() { if (empty($this->choices)) return; $name = '_customize-radio-' . $this->id; ?> label); ?>