tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary-menu' => esc_html__( 'Primary Menu', 'ananya' ), ) ); /* * Switch 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', 'gallery', 'caption', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'ananya_custom_background_args', array( 'default-color' => '#f8f8f8', 'default-image' => '', ) ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); add_image_size( 'ananya-prevnext-thumbnail', 80, 80, true ); /* Previous/Next Post navigation */ } endif; add_action( 'after_setup_theme', 'ananya_setup' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function ananya_content_width() { // This variable is intended to be overruled from themes. // Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}. // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound $GLOBALS['content_width'] = apply_filters( 'ananya_content_width', 640 ); } add_action( 'after_setup_theme', 'ananya_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function ananya_widgets_init() { //Register for sidebar widget area. register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'ananya' ), 'id' => 'ananya-sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'ananya' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); //Regsiger fotter widget area left register_sidebar( array( 'name' => esc_html__( 'Footer Widget Area - Left', 'ananya' ), 'id' => 'ananya-footer-widget-area-left', 'description' => esc_html__( 'Add widgets here.', 'ananya' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); //Regsiger fotter widget area center register_sidebar( array( 'name' => esc_html__( 'Footer Widget Area - Center', 'ananya' ), 'id' => 'ananya-footer-widget-area-center', 'description' => esc_html__( 'Add widgets here.', 'ananya' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); //Regsiger fotter widget area Right register_sidebar( array( 'name' => esc_html__( 'Footer Widget Area - Right', 'ananya' ), 'id' => 'ananya-footer-widget-area-right', 'description' => esc_html__( 'Add widgets here.', 'ananya' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'ananya_widgets_init' ); /** * Enqueue scripts and styles. */ function ananya_scripts() { //Enqueue bootstrap style wp_enqueue_style( 'bootstrap-style', get_template_directory_uri().'/assets/bootstrap/css/bootstrap.min.css' ); //Enqueue fontawesome style wp_enqueue_style( 'ananya-fontawesome-style', get_template_directory_uri().'/assets/font-awesome/css/all.min.css' ); //Enqueue v4 compatibility fontawesome style wp_enqueue_style( 'ananya-fontawesome-style', get_template_directory_uri().'/assets/font-awesome/css/v4-shims.min.css' ); //Enqueue Ananya style wp_enqueue_style( 'ananya-style', get_stylesheet_uri() ); //Enqueue navigation script wp_enqueue_script( 'ananya-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array( 'jquery' ), '20151215', true ); wp_enqueue_script( 'ananya-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array( 'jquery' ), '20151215', true ); //Enqueue bootstrap js wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/assets/bootstrap/js/bootstrap.min.js', array( 'jquery' ), false, true ); wp_enqueue_script( 'ananya-functions-js', get_template_directory_uri() . '/assets/js/ananya.js', array( 'jquery' ), false, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } wp_localize_script( 'ananya-navigation', 'ananya_screenReaderText', array( 'expand' => '' . __( 'expand child menu', 'ananya' ) . '', 'collapse' => '' . __( 'collapse child menu', 'ananya' ) . '', ) ); } add_action( 'wp_enqueue_scripts', 'ananya_scripts' ); /** * Load google fornts selected by user. * @since 1.0 * */ function ananya_google_fonts() { $fonts_url = ''; $body_font = get_theme_mod( 'ananya_body_font_select', 'Open Sans' ); $heading_font = get_theme_mod( 'ananya_heading_font_select', 'Playfair Display' ); $fonts_url = ''; if ( '' !== $body_font ) { $body_font = esc_html( $body_font ); } if ( '' !== $heading_font ) { $heading_font = esc_html( $heading_font ); } /** Translators: If there are characters in your language that are not * supported by Lora, translate this to 'off'. Do not translate * into your own language. */ $body_font_on = _x( 'on', 'Google font for body text: on or off', 'ananya' ); /* Translators: If there are characters in your language that are not * supported by heading font, translate this to 'off'. Do not translate * into your own language. */ $heading_font_on = _x( 'on', ' Gogle font for heading text: on or off', 'ananya' ); // Construct url query based on chosen fonts if ( 'off' !== $body_font_on || 'off' !== $heading_font_on ) { $font_families = array(); if ( 'off' !== $body_font_on ) { $font_families[] = $body_font; } if ( 'off' !== $heading_font_on ) { $font_families[] = $heading_font; } $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), //'subset' => urlencode( 'cyrillic,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } wp_register_style( 'ananya-google-fonts', $fonts_url, array(), null ); wp_enqueue_style( 'ananya-google-fonts' ); } add_action( 'wp_enqueue_scripts', 'ananya_google_fonts' ); /** * Change Read More link. */ function ananya_excerpt_more( $more ) { if ( is_admin() ) { return $more; } $read_more_markup = ananya_more_link(); return $read_more_markup; } add_filter( 'excerpt_more', 'ananya_excerpt_more' ); function ananya_modify_read_more_link() { $read_more_markup = ananya_more_link(); return $read_more_markup; } add_filter( 'the_content_more_link', 'ananya_modify_read_more_link' ); /** * Implement the Custom Header feature. */ require get_template_directory() . '/inc/custom-header.php'; /** * Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /** * Functions which enhance the theme by hooking into WordPress. */ require get_template_directory() . '/inc/template-functions.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Load Jetpack compatibility file. */ if ( defined( 'JETPACK__VERSION' ) ) { require get_template_directory() . '/inc/jetpack.php'; } /** * Functions to add header video settings. * @since 1.0 */ function ananya_header_video_settings( $settings ) { $settings['minWidth'] = 680; $settings['minHeight'] = 400; return $settings; } add_filter( 'header_video_settings', 'ananya_header_video_settings' ); /** * Function which returns social media menu. * @since 1.0 */ if ( ! function_exists( 'ananya_return_social_media_menu' ) ) { function ananya_return_social_media_menu( $social_class='' ) { $social_media_icons_html = ''; $social_media_icon_1 = get_theme_mod( 'ananya_social_media_icon_1', 'facebook-f' ); $social_media_icon_2 = get_theme_mod( 'ananya_social_media_icon_2', 'facebook-f' ); $social_media_icon_3 = get_theme_mod( 'ananya_social_media_icon_3', 'facebook-f' ); $social_media_icon_4 = get_theme_mod( 'ananya_social_media_icon_4', 'facebook-f' ); $social_media_url_1 = get_theme_mod( 'ananya_social_media_url_1', '' ); $social_media_url_2 = get_theme_mod( 'ananya_social_media_url_2', '' ); $social_media_url_3 = get_theme_mod( 'ananya_social_media_url_3', '' ); $social_media_url_4 = get_theme_mod( 'ananya_social_media_url_4', '' ); $show_serchbox = get_theme_mod( 'ananya_searchbox_display_setting', true ); $social_media_icons_html .= '
'; $social_media_icons_html .= '
'; return $social_media_icons_html; } }