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( 'ayaphotography-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', ayaphotography_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', 'ayaphotography' ), ) ); $defaults = array( 'flex-height' => false, 'flex-width' => false, 'header-text' => array( 'site-title', 'site-description' ), ); add_theme_support( 'custom-logo', $defaults ); } endif; // ayaphotography_setup add_action( 'after_setup_theme', 'ayaphotography_setup' ); if ( ! function_exists( 'ayaphotography_load_scripts' ) ) : /** * the main function to load scripts in the ayaphotography 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 ayaphotography_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( 'ayaphotography-style', get_stylesheet_uri(), array() ); wp_enqueue_style( 'ayaphotography-fonts', ayaphotography_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( 'modernizr', get_template_directory_uri() . '/js/modernizr.min.js', array( 'jquery' ) ); wp_enqueue_script( 'classie', get_template_directory_uri() . '/js/classie.js', array( 'jquery', 'modernizr', ) ); wp_enqueue_script( 'photostack', get_template_directory_uri() . '/js/photostack.js', array( 'jquery', 'classie', 'modernizr', ) ); wp_enqueue_script( 'ayaphotography-utilities', get_template_directory_uri() . '/js/utilities.js', array( 'jquery', 'viewportchecker', 'photostack' ) ); $data = array( 'loading_effect' => ( get_theme_mod('ayaphotography_animations_display', 1) == 1 ), ); wp_localize_script('ayaphotography-utilities', 'ayaphotography_options', $data); } endif; // ayaphotography_load_scripts add_action( 'wp_enqueue_scripts', 'ayaphotography_load_scripts' ); if ( ! function_exists( 'ayaphotography_widgets_init' ) ) : /** * widgets-init action handler. Used to register widgets and register widget areas */ function ayaphotography_widgets_init() { // Register Sidebar Widget. register_sidebar( array ( 'name' => __( 'Sidebar Widget Area', 'ayaphotography'), 'id' => 'sidebar-widget-area', 'description' => __( 'The sidebar widget area', 'ayaphotography'), 'before_widget' => '', 'after_widget' => '', 'before_title' => '
You can completely customize Slide Background Image, Title, Text, Link URL and Text.
Navigate to Admin Panel -> Left Menu -> Appearance -> Customize -> Slider Section, update slider fields and save changes.
', 'ayaphotography' ), 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayaphotography_slide1_content', array( 'label' => __( 'Slide #1 Content', 'ayaphotography' ), 'section' => 'ayaphotography_slider_section', 'settings' => 'ayaphotography_slide1_content', 'type' => 'textarea', ) ) ); // Add slide 1 background image $wp_customize->add_setting( 'ayaphotography_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, 'ayaphotography_slide1_image', array( 'label' => __( 'Slide 1 Image (Recommended Size: 240px x 240px)', 'ayaphotography' ), 'section' => 'ayaphotography_slider_section', 'settings' => 'ayaphotography_slide1_image', ) ) ); // Add slide 2 content $wp_customize->add_setting( 'ayaphotography_slide2_content', array( 'default' => __( 'You can completely customize Slide Background Image, Title, Text, Link URL and Text.
Navigate to Admin Panel -> Left Menu -> Appearance -> Customize -> Slider Section, update slider fields and save changes.
', 'ayaphotography' ), 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayaphotography_slide2_content', array( 'label' => __( 'Slide #2 Content', 'ayaphotography' ), 'section' => 'ayaphotography_slider_section', 'settings' => 'ayaphotography_slide2_content', 'type' => 'textarea', ) ) ); // Add slide 2 background image $wp_customize->add_setting( 'ayaphotography_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, 'ayaphotography_slide2_image', array( 'label' => __( 'Slide 2 Image (Recommended Size: 240px x 240px)', 'ayaphotography' ), 'section' => 'ayaphotography_slider_section', 'settings' => 'ayaphotography_slide2_image', ) ) ); // Add slide 3 content $wp_customize->add_setting( 'ayaphotography_slide3_content', array( 'default' => __( 'You can completely customize Slide Background Image, Title, Text, Link URL and Text.
Navigate to Admin Panel -> Left Menu -> Appearance -> Customize -> Slider Section, update slider fields and save changes.
', 'ayaphotography' ), 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayaphotography_slide3_content', array( 'label' => __( 'Slide #3 Content', 'ayaphotography' ), 'section' => 'ayaphotography_slider_section', 'settings' => 'ayaphotography_slide3_content', 'type' => 'textarea', ) ) ); // Add slide 3 background image $wp_customize->add_setting( 'ayaphotography_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, 'ayaphotography_slide3_image', array( 'label' => __( 'Slide 3 Image (Recommended Size: 240px x 240px)', 'ayaphotography' ), 'section' => 'ayaphotography_slider_section', 'settings' => 'ayaphotography_slide3_image', ) ) ); // Add slide 4 content $wp_customize->add_setting( 'ayaphotography_slide4_content', array( 'default' => __( 'You can completely customize Slide Background Image, Title, Text, Link URL and Text.
Navigate to Admin Panel -> Left Menu -> Appearance -> Customize -> Slider Section, update slider fields and save changes.
', 'ayaphotography' ), 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayaphotography_slide4_content', array( 'label' => __( 'Slide #4 Content', 'ayaphotography' ), 'section' => 'ayaphotography_slider_section', 'settings' => 'ayaphotography_slide4_content', 'type' => 'textarea', ) ) ); // Add slide 4 background image $wp_customize->add_setting( 'ayaphotography_slide4_image', array( 'default' => get_template_directory_uri().'/images/slider/' . '4.jpg', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'ayaphotography_slide4_image', array( 'label' => __( 'Slide 4 Image (Recommended Size: 240px x 240px)', 'ayaphotography' ), 'section' => 'ayaphotography_slider_section', 'settings' => 'ayaphotography_slide4_image', ) ) ); // Add slide 5 content $wp_customize->add_setting( 'ayaphotography_slide5_content', array( 'default' => __( 'You can completely customize Slide Background Image, Title, Text, Link URL and Text.
Navigate to Admin Panel -> Left Menu -> Appearance -> Customize -> Slider Section, update slider fields and save changes.
', 'ayaphotography' ), 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayaphotography_slide5_content', array( 'label' => __( 'Slide #5 Content', 'ayaphotography' ), 'section' => 'ayaphotography_slider_section', 'settings' => 'ayaphotography_slide5_content', 'type' => 'textarea', ) ) ); // Add slide 5 background image $wp_customize->add_setting( 'ayaphotography_slide5_image', array( 'default' => get_template_directory_uri().'/images/slider/' . '5.jpg', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'ayaphotography_slide5_image', array( 'label' => __( 'Slide 5 Image (Recommended Size: 240px x 240px)', 'ayaphotography' ), 'section' => 'ayaphotography_slider_section', 'settings' => 'ayaphotography_slide5_image', ) ) ); /** * Add Footer Section */ $wp_customize->add_section( 'ayaphotography_footer_section', array( 'title' => __( 'Footer', 'ayaphotography' ), 'capability' => 'edit_theme_options', ) ); // Add Footer Copyright Text $wp_customize->add_setting( 'ayaphotography_footer_copyright', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayaphotography_footer_copyright', array( 'label' => __( 'Copyright Text', 'ayaphotography' ), 'section' => 'ayaphotography_footer_section', 'settings' => 'ayaphotography_footer_copyright', 'type' => 'text', ) ) ); /** * Add Animations Section */ $wp_customize->add_section( 'ayaphotography_animations_display', array( 'title' => __( 'Animations', 'ayaphotography' ), 'capability' => 'edit_theme_options', ) ); // Add display Animations option $wp_customize->add_setting( 'ayaphotography_animations_display', array( 'default' => 1, 'sanitize_callback' => 'ayaphotography_sanitize_checkbox', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ayaphotography_animations_display', array( 'label' => __( 'Enable Animations', 'ayaphotography' ), 'section' => 'ayaphotography_animations_display', 'settings' => 'ayaphotography_animations_display', 'type' => 'checkbox', ) ) ); } endif; // ayaphotography_customize_register add_action( 'customize_register', 'ayaphotography_customize_register' ); if ( ! function_exists( 'ayaphotography_sanitize_checkbox' ) ) : function ayaphotography_sanitize_checkbox( $checked ) { // Boolean check. return ( ( isset( $checked ) && true == $checked ) ? true : false ); } endif; // ayaphotography_sanitize_checkbox