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' => esc_html__( 'Primary', 'ascendoor-magazine' ), 'social' => esc_html__( 'Social', 'ascendoor-magazine' ), ) ); /* * 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( 'ascendoor_magazine_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' => 250, 'width' => 250, 'flex-width' => true, 'flex-height' => true, ) ); /** * Add theme support for gutenberg block. */ add_theme_support( 'align-wide' ); add_theme_support( 'responsive-embeds' ); } endif; add_action( 'after_setup_theme', 'ascendoor_magazine_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 ascendoor_magazine_content_width() { $GLOBALS['content_width'] = apply_filters( 'ascendoor_magazine_content_width', 640 ); } add_action( 'after_setup_theme', 'ascendoor_magazine_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function ascendoor_magazine_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'ascendoor-magazine' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'ascendoor-magazine' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Primary Widgets Section', 'ascendoor-magazine' ), 'id' => 'primary-widgets-section', 'description' => esc_html__( 'Add primary widgets here.', 'ascendoor-magazine' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Secondary Widgets Section', 'ascendoor-magazine' ), 'id' => 'secondary-widgets-section', 'description' => esc_html__( 'Add secondary widgets here.', 'ascendoor-magazine' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Above Footer Widgets Section', 'ascendoor-magazine' ), 'id' => 'above-footer-widgets-section', 'description' => esc_html__( 'Add above footer widgets here.', 'ascendoor-magazine' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); // Regsiter 4 footer widgets. register_sidebars( 4, array( /* translators: %d: Footer Widget count. */ 'name' => esc_html__( 'Footer Widget %d', 'ascendoor-magazine' ), 'id' => 'footer-widget', 'description' => esc_html__( 'Add widgets here.', 'ascendoor-magazine' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); } add_action( 'widgets_init', 'ascendoor_magazine_widgets_init' ); /** * Enqueue scripts and styles. */ function ascendoor_magazine_scripts() { // Append .min if SCRIPT_DEBUG is false. $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; // Slick style. wp_enqueue_style( 'ascendoor-magazine-slick-style', get_template_directory_uri() . '/assets/css/slick' . $min . '.css', array(), '1.8.1' ); // Fontawesome style. wp_enqueue_style( 'ascendoor-magazine-fontawesome-style', get_template_directory_uri() . '/assets/css/fontawesome' . $min . '.css', array(), '5.15.4' ); // Google fonts. wp_enqueue_style( 'ascendoor-magazine-google-fonts', wptt_get_webfont_url( ascendoor_magazine_get_fonts_url() ), array(), null ); // Main style. wp_enqueue_style( 'ascendoor-magazine-style', get_template_directory_uri() . '/style.css', array(), ASCENDOOR_MAGAZINE_VERSION ); // Navigation script. wp_enqueue_script( 'ascendoor-magazine-navigation-script', get_template_directory_uri() . '/assets/js/navigation.js', array(), ASCENDOOR_MAGAZINE_VERSION, true ); // Slick script. wp_enqueue_script( 'ascendoor-magazine-slick-script', get_template_directory_uri() . '/assets/js/slick' . $min . '.js', array( 'jquery' ), '1.8.1', true ); // jQuery marquee script. wp_enqueue_script( 'ascendoor-magazine-marquee-script', get_template_directory_uri() . '/assets/js/jquery.marquee' . $min . '.js', array( 'jquery' ), '1.6.0', true ); // Custom script. wp_enqueue_script( 'ascendoor-magazine-custom-script', get_template_directory_uri() . '/assets/js/custom' . $min . '.js', array( 'jquery' ), ASCENDOOR_MAGAZINE_VERSION, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'ascendoor_magazine_scripts' ); /** * Include wptt webfont loader. */ require_once get_theme_file_path( 'inc/wptt-webfont-loader.php' ); /** * 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'; /** * Widgets. */ require get_template_directory() . '/inc/widgets/widgets.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Google Fonts */ require get_template_directory() . '/inc/google-fonts.php'; /** * Dynamic CSS */ require get_template_directory() . '/inc/dynamic-css.php'; /** * Breadcrumb */ require get_template_directory() . '/inc/class-breadcrumb-trail.php'; /** * Recommended Plugins */ require get_template_directory() . '/inc/tgmpa/recommended-plugins.php'; /** * Category color. */ require get_template_directory() . '/inc/custom-category-color.php'; /** * One Click Demo Import after import setup. */ if ( class_exists( 'OCDI_Plugin' ) ) { require get_template_directory() . '/inc/ocdi.php'; } /** * Load Jetpack compatibility file. */ if ( defined( 'JETPACK__VERSION' ) ) { require get_template_directory() . '/inc/jetpack.php'; }