for posts and comments. add_theme_support( 'automatic-feed-links' ); /* * Switches default core markup for search form, comment form, * and comments to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) ); /* * This theme supports all available post formats by default. * See http://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'audio', 'quote', 'video', 'link' ) ); /* Custom Header */ add_theme_support('custom-header',array( 'height' => 450, 'width' => 1920, 'flex-width' => true, 'flex-height' => false, 'header-text' => false, 'random-default' => false )); // This theme uses wp_nav_menu() in one location. register_nav_menus(array( 'top-menu' => __( 'Top Menu', 'calm' ), 'mobile-menu' => __('Mobile Top Menu', 'calm'), 'footer-menu' => __('Footer Menu', 'calm') )); /* * This theme uses a custom image size for featured images, displayed on * "standard" posts and pages. */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 220, 340, true ); add_image_size( 'image',770, 335, true ); // added by ankit add_theme_support( 'title-tag' );; } add_action( 'after_setup_theme', 'calm_setup' ); function calm_scripts_styles() { /* * Adds JavaScript to pages with the comment form to support * sites with threaded comments (when in use). */ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); wp_enqueue_script('calm-custom',get_template_directory_uri().'/js/calm-custom.js',array('jquery'),'',true); wp_enqueue_script('smoothScroll',get_template_directory_uri().'/js/SmoothScroll.js',array('jquery'),'',true); // Add fonts, icons used in the main stylesheet. wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.css', array(), '' ); wp_enqueue_style( 'bootstrap-theme', get_template_directory_uri() . '/css/bootstrap-theme.css', array(), '' ); wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '' ); // Loads our main stylesheet. wp_enqueue_style( 'calm-style', get_stylesheet_uri(), array(), '' ); } add_action( 'wp_enqueue_scripts', 'calm_scripts_styles' ); function calm_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'Calm' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'calm_wp_title', 10, 2 ); /* Excerpt Filter */ function calm_excerpt_length( $length ) { return 110; } add_filter( 'excerpt_length', 'calm_excerpt_length', 999 ); /* Excerpt More */ function new_excerpt_more( $more ) { return ' .....'; } add_filter('excerpt_more', 'new_excerpt_more'); function calm_widgets(){ /* Dynamic Sidebar */ register_sidebar(array( 'id' => 'sidebar', 'name' => __( 'Right Sidebar', 'calm' ), 'description' => __( 'This sidebar is located right side.', 'calm' ), 'before_widget' => '
', 'before_title' => '' . '' . '
', 'email' => '' . '' . '
', 'url' => '' . '' . '
' ); return $fields; } add_filter('comment_form_default_fields', 'calm_custom_comment_fields');