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' ); add_image_size( 'ayageek-thumbnail-avatar', 100, 100, true ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', ) ); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, and column width. */ add_editor_style( array( 'css/editor-style.css', get_template_directory_uri() . '/css/font-awesome.css', ayageek_fonts_url() ) ); /* * Set Custom Background */ add_theme_support( 'custom-background', array ('default-color' => '#ffffff') ); // Set the default content width. $GLOBALS['content_width'] = 900; // This theme uses wp_nav_menu() in header menu register_nav_menus( array( 'primary' => __( 'Primary Menu', 'ayageek' ), ) ); $defaults = array( 'flex-height' => false, 'flex-width' => false, 'header-text' => array( 'site-title', 'site-description' ), ); add_theme_support( 'custom-logo', $defaults ); } endif; // ayageek_setup add_action( 'after_setup_theme', 'ayageek_setup' ); if ( ! function_exists( 'ayageek_load_scripts' ) ) : /** * the main function to load scripts in the ayageek theme * if you add a new load of script, style, etc. you can use that function * instead of adding a new wp_enqueue_scripts action for it. */ function ayageek_load_scripts() { // load main stylesheet. wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.css', array( ) ); wp_enqueue_style( 'animate-css', get_template_directory_uri() . '/css/animate.css', array( ) ); wp_enqueue_style( 'ayageek-style', get_stylesheet_uri(), array() ); wp_enqueue_style( 'ayageek-fonts', ayageek_fonts_url(), array(), null ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // Load Utilities JS Script wp_enqueue_script( 'viewportchecker', get_template_directory_uri() . '/js/viewportchecker.js', array( 'jquery' ) ); wp_enqueue_script( 'bxslider', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array( 'jquery' ) ); wp_enqueue_script( 'ayageek-utilities', get_template_directory_uri() . '/js/utilities.js', array( 'jquery', 'viewportchecker', 'bxslider' ) ); $data = array( 'loading_effect' => ( get_theme_mod('ayageek_animations_display', 1) == 1 ), ); wp_localize_script('ayageek-utilities', 'ayageek_options', $data); } endif; // ayageek_load_scripts add_action( 'wp_enqueue_scripts', 'ayageek_load_scripts' ); if ( ! function_exists( 'ayageek_widgets_init' ) ) : /** * widgets-init action handler. Used to register widgets and register widget areas */ function ayageek_widgets_init() { // Register Sidebar Widget. register_sidebar( array ( 'name' => __( 'Sidebar Widget Area', 'ayageek'), 'id' => 'sidebar-widget-area', 'description' => __( 'The sidebar widget area', 'ayageek'), 'before_widget' => '', 'after_widget' => '', 'before_title' => '
You can completely customize Slide Background Image, Title, Text, Link URL and Text.
Read more', 'ayageek' ), 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayageek_slide1_content', array( 'label' => __( 'Slide #1 Content', 'ayageek' ), 'section' => 'ayageek_slider_section', 'settings' => 'ayageek_slide1_content', 'type' => 'textarea', ) ) ); // Add slide 1 background image $wp_customize->add_setting( 'ayageek_slide1_image', array( 'default' => get_template_directory_uri().'/images/slider/' . '1.jpg', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'ayageek_slide1_image', array( 'label' => __( 'Slide 1 Image', 'ayageek' ), 'section' => 'ayageek_slider_section', 'settings' => 'ayageek_slide1_image', ) ) ); // Add slide 2 content $wp_customize->add_setting( 'ayageek_slide2_content', array( 'default' => __( 'You can completely customize Slide Background Image, Title, Text, Link URL and Text.
Read more', 'ayageek' ), 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayageek_slide2_content', array( 'label' => __( 'Slide #2 Content', 'ayageek' ), 'section' => 'ayageek_slider_section', 'settings' => 'ayageek_slide2_content', 'type' => 'textarea', ) ) ); // Add slide 2 background image $wp_customize->add_setting( 'ayageek_slide2_image', array( 'default' => get_template_directory_uri().'/images/slider/' . '2.jpg', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'ayageek_slide2_image', array( 'label' => __( 'Slide 2 Image', 'ayageek' ), 'section' => 'ayageek_slider_section', 'settings' => 'ayageek_slide2_image', ) ) ); // Add slide 3 content $wp_customize->add_setting( 'ayageek_slide3_content', array( 'default' => __( 'You can completely customize Slide Background Image, Title, Text, Link URL and Text.
Read more', 'ayageek' ), 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayageek_slide3_content', array( 'label' => __( 'Slide #3 Content', 'ayageek' ), 'section' => 'ayageek_slider_section', 'settings' => 'ayageek_slide3_content', 'type' => 'textarea', ) ) ); // Add slide 3 background image $wp_customize->add_setting( 'ayageek_slide3_image', array( 'default' => get_template_directory_uri().'/images/slider/' . '3.jpg', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'ayageek_slide3_image', array( 'label' => __( 'Slide 3 Image', 'ayageek' ), 'section' => 'ayageek_slider_section', 'settings' => 'ayageek_slide3_image', ) ) ); /** * Add Footer Section */ $wp_customize->add_section( 'ayageek_footer_section', array( 'title' => __( 'Footer', 'ayageek' ), 'capability' => 'edit_theme_options', ) ); // Add Footer Copyright Text $wp_customize->add_setting( 'ayageek_footer_copyright', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayageek_footer_copyright', array( 'label' => __( 'Copyright Text', 'ayageek' ), 'section' => 'ayageek_footer_section', 'settings' => 'ayageek_footer_copyright', 'type' => 'text', ) ) ); /** * Add Animations Section */ $wp_customize->add_section( 'ayageek_animations_display', array( 'title' => __( 'Animations', 'ayageek' ), 'capability' => 'edit_theme_options', ) ); // Add display Animations option $wp_customize->add_setting( 'ayageek_animations_display', array( 'default' => 1, 'sanitize_callback' => 'ayageek_sanitize_checkbox', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayageek_animations_display', array( 'label' => __( 'Enable Animations', 'ayageek' ), 'section' => 'ayageek_animations_display', 'settings' => 'ayageek_animations_display', 'type' => 'checkbox', ) ) ); } endif; // ayageek_customize_register add_action( 'customize_register', 'ayageek_customize_register' ); if ( ! function_exists( 'ayageek_sanitize_checkbox' ) ) : function ayageek_sanitize_checkbox( $checked ) { // Boolean check. return ( ( isset( $checked ) && true == $checked ) ? true : false ); } endif; // ayageek_sanitize_checkbox