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. * * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 825, 510, true ); // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( 'primary' => __( 'Primary Menu', 'aadi' ), ) ); /* * 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' ) ); add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat' ) ); $color_scheme = aadi_get_color_scheme(); $default_color = trim( $color_scheme[0], '#' ); /* * Enable support for custom logo. * * @since Twenty Fifteen 1.5 */ add_theme_support( 'custom-logo', array( 'width' => 161, 'height' => 65, 'flex-height' => true, ) ); // Setup the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'aadi_custom_background_args', array( 'default-color' => $default_color, 'default-attachment' => 'fixed', ) ) ); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, icons, and column width. */ add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', aadi_fonts_url() ) ); } endif; // aadi_setup add_action( 'after_setup_theme', 'aadi_setup' ); /** * Register widget area. */ function aadi_widgets_init() { register_sidebar( array( 'name' => __( 'Widget Area', 'aadi' ), 'id' => 'sidebar-1', 'description' => __( 'Add widgets here to appear in your sidebar.', 'aadi' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'aadi_widgets_init' ); if ( ! function_exists( 'aadi_fonts_url' ) ) : /** * Register Google fonts for Aadi. */ function aadi_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; /* * Translators: If there are characters in your language that are not supported * by Noto Sans, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Noto Sans font: on or off', 'aadi' ) ) { $fonts[] = 'Noto Sans:400italic,700italic,400,700'; } /* * Translators: If there are characters in your language that are not supported * by Noto Serif, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Noto Serif font: on or off', 'aadi' ) ) { $fonts[] = 'Noto Serif:400italic,700italic,400,700'; } /* * Translators: If there are characters in your language that are not supported * by Inconsolata, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'aadi' ) ) { $fonts[] = 'Inconsolata:400,700'; } /* * Translators: To add an additional character subset specific to your language, * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. */ $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'aadi' ); if ( 'cyrillic' == $subset ) { $subsets .= ',cyrillic,cyrillic-ext'; } elseif ( 'greek' == $subset ) { $subsets .= ',greek,greek-ext'; } elseif ( 'devanagari' == $subset ) { $subsets .= ',devanagari'; } elseif ( 'vietnamese' == $subset ) { $subsets .= ',vietnamese'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ), '//fonts.googleapis.com/css' ); } return $fonts_url; } endif; /** * JavaScript Detection. */ function aadi_javascript_detection() { echo "\n"; } add_action( 'wp_head', 'aadi_javascript_detection', 0 ); /** * Enqueue scripts and styles. */ function aadi_scripts() { wp_enqueue_script( 'tether.min', get_template_directory_uri() . '/js/tether.min.js', array(), '20141010', false ); // Add custom fonts, used in the main stylesheet. wp_enqueue_style( 'aadi-fonts', aadi_fonts_url(), array(), null ); // Add Genericons, used in the main stylesheet. wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.2' ); // Load our main stylesheet. wp_enqueue_style( 'bootstrap.min', get_template_directory_uri().'/css/bootstrap.min.css'); wp_enqueue_style( 'custom', get_template_directory_uri().'/css/custom.css'); wp_enqueue_style( 'animate', get_template_directory_uri().'/css/animate.css'); wp_enqueue_style( 'font-awesome', get_template_directory_uri().'/css/font-awesome.css'); wp_enqueue_style( 'jquery.bxslider', get_template_directory_uri().'/css/jquery.bxslider.css'); wp_enqueue_style( 'nivo-slider', get_template_directory_uri().'/css/nivo-slider.css'); wp_enqueue_style( 'slicknav.min', get_template_directory_uri().'/css/slicknav.min.css'); wp_enqueue_style( 'slider', get_template_directory_uri().'/css/slider.css'); // Load the Internet Explorer specific stylesheet. wp_enqueue_style( 'aadi-ie', get_template_directory_uri() . '/css/ie.css', array( 'aadi-style' ), '20141010' ); wp_style_add_data( 'aadi-ie', 'conditional', 'lt IE 9' ); // Load the Internet Explorer 7 specific stylesheet. wp_enqueue_style( 'aadi-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'aadi-style' ), '20141010' ); wp_style_add_data( 'aadi-ie7', 'conditional', 'lt IE 8' ); wp_enqueue_style( 'aadi-style', get_stylesheet_uri() ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'aadi-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20141010', true ); wp_enqueue_script( 'bootstrap.min', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '20141010', true ); wp_enqueue_script( 'jquery.nivo.slider', get_template_directory_uri() . '/js/jquery.nivo.slider.js', array(), '20141010', true ); wp_enqueue_script( 'wow.min', get_template_directory_uri() . '/js/wow.min.js', array(), '20141010', true ); wp_enqueue_script( 'jquery.bxslider.min', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array(), '20141010', true ); wp_enqueue_script( 'jquery.simpleslider', get_template_directory_uri() . '/js/jquery.simpleslider.js', array(), '20141010', true ); wp_enqueue_script( 'canvas', get_template_directory_uri() . '/js/canvas.js', array(), '20141010', true ); wp_enqueue_script( 'jquery.slicknav.min', get_template_directory_uri() . '/js/jquery.slicknav.min.js', array(), '20141010', true ); wp_enqueue_script( 'main', get_template_directory_uri() . '/js/main.js', array(), '20141010', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'aadi-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20141010' ); } wp_enqueue_script( 'aadi-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150330', true ); wp_localize_script( 'aadi-script', 'screenReaderText', array( 'expand' => '' . __( 'expand child menu', 'aadi' ) . '', 'collapse' => '' . __( 'collapse child menu', 'aadi' ) . '', ) ); } add_action( 'wp_enqueue_scripts', 'aadi_scripts' ); /** * Add featured image as background image to post navigation elements. */ function aadi_post_nav_background() { if ( ! is_single() ) { return; } $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); $css = ''; if ( is_attachment() && 'attachment' == $previous->post_type ) { return; } if ( $previous && has_post_thumbnail( $previous->ID ) ) { $prevthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $previous->ID ), 'post-thumbnail' ); $css .= ' .post-navigation .nav-previous { background-image: url(' . esc_url( $prevthumb[0] ) . '); } .post-navigation .nav-previous .post-title, .post-navigation .nav-previous a:hover .post-title, .post-navigation .nav-previous .meta-nav { color: #fff; } .post-navigation .nav-previous a:before { background-color: rgba(0, 0, 0, 0.4); } '; } if ( $next && has_post_thumbnail( $next->ID ) ) { $nextthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $next->ID ), 'post-thumbnail' ); $css .= ' .post-navigation .nav-next { background-image: url(' . esc_url( $nextthumb[0] ) . '); border-top: 0; } .post-navigation .nav-next .post-title, .post-navigation .nav-next a:hover .post-title, .post-navigation .nav-next .meta-nav { color: #fff; } .post-navigation .nav-next a:before { background-color: rgba(0, 0, 0, 0.4); } '; } wp_add_inline_style( 'aadi-style', $css ); } add_action( 'wp_enqueue_scripts', 'aadi_post_nav_background' ); /** * Display descriptions in main navigation. * @param string $item_output The menu item output. * @param WP_Post $item Menu item object. * @param int $depth Depth of the menu. * @param array $args wp_nav_menu() arguments. * @return string Menu item with possible description. */ function aadi_nav_description( $item_output, $item, $depth, $args ) { if ( 'primary' == $args->theme_location && $item->description ) { $item_output = str_replace( $args->link_after . '', '' . $args->link_after . '', $item_output ); } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'aadi_nav_description', 10, 4 ); /** * Add a `screen-reader-text` class to the search form's submit button. * @return string Modified search form HTML. */ function aadi_search_form_modify( $html ) { return str_replace( 'class="search-submit"', 'class="search-submit screen-reader-text"', $html ); } add_filter( 'get_search_form', 'aadi_search_form_modify' ); add_image_size( 'comment-image', 141, 141, true ); add_image_size( 'latest-posts', 418, 384, true ); add_image_size( 'team-icons', 261, 261, true ); add_image_size( 'feature-section', 164, 181, true ); add_image_size( 'blog-page-main-image', 1920, 667, true ); add_image_size( 'blog-page-images', 359, 252, true ); add_image_size( 'blogdetail-page-image', 1920, 489, true ); add_image_size( 'aboutus-page-image', 1920, 543, true ); /** * 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'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * /** * register widget file */ require get_template_directory() . '/inc/register-widget-area.php'; /* /** * theme option page file */ require get_template_directory() . '/functions/theme-option-page.php'; /** * Add the widgets in to the site-origin page builder. */ require get_template_directory() . '/inc/panels.php'; /** * show the required in plugins message to the user. */ add_action('admin_notices', 'showAdminMessages'); function showAdminMessages() { $plugin_messages = array(); include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Download the CONTACT FORM 7 plugin if(!is_plugin_active( 'contact-form-7/wp-contact-form-7.php' )) { $plugin_messages[] = 'Aadi theme recommended you to install the CONTACT fORM7 plugin, download it from here.'; } // Download the META SLIDER plugin if(!is_plugin_active( 'ml-slider/ml-slider.php' )) { $plugin_messages[] = 'Aadi theme recommended you to install the META SLIDER plugin, download it from here.'; } // Download the SITE ORIGIN- PAGE BUILDER if(!is_plugin_active( 'siteorigin-panels/siteorigin-panels.php' )) { $plugin_messages[] = 'Aadi theme recommended you to install the PAGE BUILDER BY SITEORIGIN plugin, download it from here.'; } // Download the Advanced custom field plugin if(!is_plugin_active( 'advanced-custom-fields/acf.php' )) { $plugin_messages[] = 'Aadi theme recommended you to install the ADVANCED CUSTOM FIELDS plugin, download it from here.'; } if(count($plugin_messages) > 0) { echo '
'; foreach($plugin_messages as $message) { echo '

'.$message.'

'; } echo '
'; } } /** * predefined frields of acf */ if(function_exists("register_field_group")) { register_field_group(array ( 'id' => 'acf_additional-fields-for-slides', 'title' => 'Additional Fields For Slides', 'fields' => array ( array ( 'key' => 'field_57e0e3d4d27e9', 'label' => 'First Button Text', 'name' => 'first_button_text', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), array ( 'key' => 'field_57e0e3e4d27ea', 'label' => 'First Button Link', 'name' => 'first_button_link', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), array ( 'key' => 'field_57e0e3f5d27eb', 'label' => 'Second Button Link', 'name' => 'second_button_link', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), array ( 'key' => 'field_57e0e406d27ec', 'label' => 'Second Button Text', 'name' => 'second_button_text', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), ), 'location' => array ( array ( array ( 'param' => 'post_type', 'operator' => '==', 'value' => 'post', 'order_no' => 0, 'group_no' => 0, ), ), ), 'options' => array ( 'position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array ( ), ), 'menu_order' => 0, )); register_field_group(array ( 'id' => 'acf_additional-fields-for-team', 'title' => 'Additional Fields For Team', 'fields' => array ( array ( 'key' => 'field_57e0d2d2bc64e', 'label' => 'Facebook Link', 'name' => 'facebook_link', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), array ( 'key' => 'field_57e0d2e7bc64f', 'label' => 'Twitter Link', 'name' => 'twitter_link', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), array ( 'key' => 'field_57e0d2fbbc650', 'label' => 'Behance Link', 'name' => 'behance_link', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), array ( 'key' => 'field_57e0d30dbc651', 'label' => 'Linkedin Link', 'name' => 'linkedin_link', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), ), 'location' => array ( array ( array ( 'param' => 'post_type', 'operator' => '==', 'value' => 'post', 'order_no' => 0, 'group_no' => 0, ), ), ), 'options' => array ( 'position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array ( ), ), 'menu_order' => 0, )); register_field_group(array ( 'id' => 'acf_additional-fields-for-testimonial', 'title' => 'Additional Fields For Testimonial', 'fields' => array ( array ( 'key' => 'field_57e0cefce179b', 'label' => 'Designation', 'name' => 'designation', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), ), 'location' => array ( array ( array ( 'param' => 'post_type', 'operator' => '==', 'value' => 'post', 'order_no' => 0, 'group_no' => 0, ), ), ), 'options' => array ( 'position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array ( ), ), 'menu_order' => 0, )); register_field_group(array ( 'id' => 'acf_additional-fields-for-work', 'title' => 'Additional Fields For Work', 'fields' => array ( array ( 'key' => 'field_57e0df5cdec2e', 'label' => 'Extra Field', 'name' => 'extra_field', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), array ( 'key' => 'field_57e0e07bdec2f', 'label' => 'Link One ', 'name' => 'link_one_', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), array ( 'key' => 'field_57e0e08bdec30', 'label' => 'Link One Text', 'name' => 'link_one_text', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), array ( 'key' => 'field_57e0e09edec31', 'label' => 'Link Two', 'name' => 'link_two', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), array ( 'key' => 'field_57e0e0acdec32', 'label' => 'Link Two Text', 'name' => 'link_two_text', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), ), 'location' => array ( array ( array ( 'param' => 'post_type', 'operator' => '==', 'value' => 'post', 'order_no' => 0, 'group_no' => 0, ), ), ), 'options' => array ( 'position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array ( ), ), 'menu_order' => 0, )); }