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( 'main-menu' => esc_html__( 'Primary Menu', 'alley-home-services' ) ) ); if ( alley_home_services_set_pro_active() ) { register_nav_menus( array( 'top-menu' => esc_html__( 'Secondary Menu', 'alley-home-services' ) ) ); } /* * 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', 'style', 'script', ) ); // Set up the WordPress core custom background feature. add_theme_support('custom-background', apply_filters( 'alley_home_services_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'height' => 170, 'width' => 54, 'flex-width' => true, 'flex-height' => true, ) ); add_editor_style( get_stylesheet_uri() ); } endif; add_action( 'after_setup_theme', 'alley_home_services_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 alley_home_services_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( 'alley_home_services_content_width', 640 ); } add_action( 'after_setup_theme', 'alley_home_services_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function alley_home_services_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Footer Widget', 'alley-home-services' ), 'id' => 'footer-widget', 'description' => esc_html__( 'Add widgets here.', 'alley-home-services' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Right Sidebar', 'alley-home-services' ), 'id' => 'sidebar-1', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => esc_html__( 'Left Sidebar', 'alley-home-services' ), 'id' => 'left-sidebar', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); } add_action( 'widgets_init', 'alley_home_services_widgets_init' ); /** * Enqueue scripts and styles. */ function alley_home_services_scripts() { $font_family = get_theme_mod( 'font_family', 'Montserrat' ); $heading_font_family = get_theme_mod( 'heading_font_family', 'Poppins' ); $site_identity_font_family = esc_attr( get_theme_mod( 'site_identity_font_family', 'Montserrat' ) ); wp_enqueue_style( 'one-page-conference-googlefonts', 'https://fonts.googleapis.com/css?family='. esc_attr( $font_family ) . ':200,300,400,500,600,700,800,900|' . esc_attr( $heading_font_family ) . ':200,300,400,500,600,700,800,900|' . esc_attr( $site_identity_font_family ) . ':200,300,400,500,600,700,800,900|' ); wp_enqueue_style( 'alley-home-services-style', get_stylesheet_uri(), array(), ALLEY_HOME_SERVICES_VERSION ); wp_style_add_data( 'alley-home-services-style', 'rtl', 'replace' ); wp_enqueue_style( 'all-fontawesome', get_template_directory_uri() . '/css/all.min.css', array(), ALLEY_HOME_SERVICES_VERSION ); wp_enqueue_script( 'all-fontawesome', get_template_directory_uri() . '/js/all.min.js', array(), ALLEY_HOME_SERVICES_VERSION, true ); wp_enqueue_script( 'alley-home-services-script', get_template_directory_uri() . '/js/script.js', array(), ALLEY_HOME_SERVICES_VERSION, true ); wp_enqueue_script( 'alley-home-services-navigation', get_template_directory_uri() . '/js/navigation.js', array(), ALLEY_HOME_SERVICES_VERSION, true ); wp_enqueue_script( 'ajax-js', get_template_directory_uri() . '/js/ajax.js', array( 'jquery' ), ALLEY_HOME_SERVICES_VERSION, true ); wp_localize_script( 'ajax-js', 'ajaxStuff', array( 'ajaxurl' => esc_url_raw(admin_url( 'admin-ajax.php' ) ), 'nonce' => wp_create_nonce( 'nonce_name' ) ) ); wp_enqueue_script( 'alley-home-services-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), ALLEY_HOME_SERVICES_VERSION, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'alley_home_services_scripts' ); // add async and defer attributes to enqueued scripts function alley_home_services_script_loader_tag($tag, $handle, $src) { if ($handle === 'all-fontawesome') { if (false === stripos($tag, 'async')) { $tag = str_replace(' src', ' async="async" src', $tag); } if (false === stripos($tag, 'defer')) { $tag = str_replace('