remove_control("display_header_text"); $wp_customize->remove_section("header_textcolor"); $wp_customize->get_section('header_image')->title = __( 'Banner Image for inner pages', 'blog-lite' ); } //============================================================= // Menu Fallback function //============================================================= if ( !function_exists('blog_lite_menu_fallback') ) : function blog_lite_menu_fallback(){ echo ''; } endif; //============================================================= // Function limit the number of words. //============================================================= function blog_lite_limit_words($string, $word_limit) { $words = explode(' ', $string, ($word_limit + 1)); if(count($words) > $word_limit) { if(count($words) > $word_limit) { array_pop($words); return implode(' ', $words).'...'; } } else { return $string; } } //============================================================= // Function to remove width and height attributes of featured image //============================================================= add_filter( 'post_thumbnail_html', 'blog_lite_remove_thumbnail_dimensions', 10 ); add_filter( 'image_send_to_editor', 'blog_lite_remove_thumbnail_dimensions', 10 ); function blog_lite_remove_thumbnail_dimensions( $html ) { $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html ); return $html; } //============================================================= // To add class on body for sidebar //============================================================= if ( ! function_exists( 'blog_lite_alter_body_class' ) ) { function blog_lite_alter_body_class( $classes ) { $theme_options = blog_lite_theme_options(); if( isset( $theme_options['sidebar'] ) && 'left' == $theme_options['sidebar'] ) { $sidebar_layout = 'left-sidebar'; }else { $sidebar_layout = 'right-sidebar'; } $classes[] = $sidebar_layout; return $classes; } } add_filter( 'body_class', 'blog_lite_alter_body_class' ); //============================================================= // Function to use custom css //============================================================= if ( ! function_exists( 'blog_lite_custom_css' ) ) { function blog_lite_custom_css() { $theme_options = blog_lite_theme_options(); if( !empty( $theme_options['custom_css']) ) { echo ''; } } } add_action( 'wp_head', 'blog_lite_custom_css' );