100, 'width' => 300, 'flex-width' => true, 'flex-height' => true, 'unlink-homepage-logo' => true, )); add_theme_support( 'custom-header', array( 'width' => 1920, 'height' => 800, 'flex-height' => true, 'flex-width' => true, 'header-text' => false, 'default-image' => get_template_directory_uri() . '/assets/images/header.jpg', 'uploads' => true, ) ); // We need to register our image so that we can switch back to it if needed register_default_headers( array( 'hiker' => array( 'url' => '%s/assets/images/header.jpg', 'thumbnail_url' => '%s/assets/images/header-tn.jpg', 'description' => esc_html__( 'Hiker', 'alurra' ) )) ); // Add Page Excerpt support add_post_type_support( 'page', 'excerpt' ); // Thumbnail sizes set_post_thumbnail_size( 1360, 9999 ); add_image_size( 'alrp-thumbnail', 70, 70, true ); // Register primary menu. register_nav_menus( array( 'primary' => esc_html__( 'Primary menu', 'alurra' ), 'footer' => esc_html__( 'Footer menu', 'alurra' ), 'top-social' => esc_html__( 'Top Social menu', 'alurra' ), 'bottom-social' => esc_html__( 'Bottom Social menu', 'alurra' ), )); // Add custom editor font sizes. add_theme_support( 'editor-font-sizes', array( array( 'name' => esc_html__( 'Extra small', 'alurra' ), 'shortName' => esc_html_x( 'XS', 'Font size', 'alurra' ), 'size' => 14, 'slug' => 'extra-small', ), array( 'name' => esc_html__( 'Small', 'alurra' ), 'shortName' => esc_html_x( 'S', 'Font size', 'alurra' ), 'size' => 16, 'slug' => 'small', ), array( 'name' => esc_html__( 'Normal', 'alurra' ), 'shortName' => esc_html_x( 'M', 'Font size', 'alurra' ), 'size' => 18, 'slug' => 'normal', ), array( 'name' => esc_html__( 'Large', 'alurra' ), 'shortName' => esc_html_x( 'L', 'Font size', 'alurra' ), 'size' => 24, 'slug' => 'large', ), array( 'name' => esc_html__( 'Extra large', 'alurra' ), 'shortName' => esc_html_x( 'XL', 'Font size', 'alurra' ), 'size' => 34, 'slug' => 'extra-large', ), array( 'name' => esc_html__( 'Huge', 'alurra' ), 'shortName' => esc_html_x( 'XXL', 'Font size', 'alurra' ), 'size' => 48, 'slug' => 'huge', ), array( 'name' => esc_html__( 'Gigantic', 'alurra' ), 'shortName' => esc_html_x( 'XXXL', 'Font size', 'alurra' ), 'size' => 60, 'slug' => 'gigantic', ), ) ); // Editor color palette. $black = '#000'; $dark_grey = '#222'; $light_grey = '#f1f1f1'; $brown = '#b38a2d'; $green = '#a9b87b'; $light_green = '#e2e2d1'; $white = '#ffffff'; add_theme_support( 'editor-color-palette', array( array( 'name' => esc_html__( 'Black', 'alurra' ), 'slug' => 'black', 'color' => $black, ), array( 'name' => esc_html__( 'Dark grey', 'alurra' ), 'slug' => 'dark-grey', 'color' => $dark_grey, ), array( 'name' => esc_html__( 'Light grey', 'alurra' ), 'slug' => 'light-grey', 'color' => $light_grey, ), array( 'name' => esc_html__( 'Brown', 'alurra' ), 'slug' => 'brown', 'color' => $brown, ), array( 'name' => esc_html__( 'Green', 'alurra' ), 'slug' => 'green', 'color' => $green, ), array( 'name' => esc_html__( 'Light Green', 'alurra' ), 'slug' => 'light-green', 'color' => $light_green, ), array( 'name' => esc_html__( 'White', 'alurra' ), 'slug' => 'white', 'color' => $white, ), ) ); add_theme_support( 'editor-gradient-presets', array( array( 'name' => esc_html__( 'Green to Light Green', 'alurra' ), 'gradient' => 'linear-gradient(160deg, ' . $green . ' 0%, ' . $light_green . ' 100%)', 'slug' => 'green-to-light-green', ), array( 'name' => esc_html__( 'Black to Dark Grey', 'alurra' ), 'gradient' => 'linear-gradient(160deg, ' . $black . ' 0%, ' . $dark_grey . ' 100%)', 'slug' => 'black-to-brown', ), array( 'name' => esc_html__( 'Dark Grey to Light Grey', 'alurra' ), 'gradient' => 'linear-gradient(160deg, ' . $dark_grey . ' 0%, ' . $light_grey . ' 100%)', 'slug' => 'dark-grey-to-light-grey', ), array( 'name' => esc_html__( 'Brown to White', 'alurra' ), 'gradient' => 'linear-gradient(160deg, ' . $brown . ' 0%, ' . $white . ' 100%)', 'slug' => 'brown-to-white', ), array( 'name' => esc_html__( 'Light Green to White', 'alurra' ), 'gradient' => 'linear-gradient(160deg, ' . $light_green . ' 0%, ' . $white . ' 100%)', 'slug' => 'light-green-to-white', ), ) ); } } add_action( 'after_setup_theme', 'alurra_setup' ); /* SET CONTENT WIDTH ==================================================== */ $GLOBALS['content_width'] = 1200; function alurra_content_width() { $content_width = $GLOBALS['content_width']; // Check if the page has a sidebar. if ( is_active_sidebar( 'left-sidebar' ) || is_active_sidebar( 'right-sidebar' ) || is_active_sidebar( 'blog-sidebar' ) ) { $content_width = 800; } $GLOBALS['content_width'] = apply_filters( 'alurra_content_width', $content_width ); } add_action( 'template_redirect', 'alurra_content_width', 0 ); /* SKIP LINK FOCUS ====================================================*/ function alurra_skip_link_focus_fix() { // If SCRIPT_DEBUG is defined and true, print the unminified file. if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { echo ''; } ?> get( 'Version' ); $css_dependencies = array(); // Retrieve and enqueue the URL for Google Fonts $google_fonts_url = alurra_fonts_url(); if ( $google_fonts_url ) { wp_register_style( 'alurra-google-fonts', $google_fonts_url, false, null, 'all' ); $css_dependencies[] = 'alurra-google-fonts'; } // Load our theme stylesheet wp_enqueue_style( 'alurra-style', get_template_directory_uri() . '/style.css', $css_dependencies, $theme_version ); } endif; add_action( 'wp_enqueue_scripts', 'alurra_register_styles' ); /* REGISTER SCRIPTS ==================================================== */ if ( ! function_exists( 'alurra_register_scripts' ) ) : function alurra_register_scripts() { // Version $theme_version = wp_get_theme( 'alurra' )->get( 'Version' ); // Built-in JS assets $js_dependencies = array( 'jquery' ); // Filter the list of dependencies used with JavaScript enqueues $js_dependencies = apply_filters( 'alurra_lite_js_dependencies', $js_dependencies ); // Skip to link wp_enqueue_script( 'alurra-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), null, true ); // Theme scripts $js_dependencies = array( 'jquery' ); wp_enqueue_script( 'alurra-scripts', get_template_directory_uri() . '/assets/js/theme-scripts.js', $js_dependencies, $theme_version, true ); // Check Comments if ( ( ! is_admin() ) && is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'alurra_register_scripts' ); endif; /* EDITOR STYLES FOR THE BLOCK EDITOR ==================================================== */ if ( ! function_exists( 'alurra_block_editor_styles' ) ) : function alurra_block_editor_styles() { $css_dependencies = array(); // Retrieve and enqueue the URL for Google Fonts $google_fonts_url = alurra_fonts_url(); if ( $google_fonts_url ) { wp_register_style( 'alurra_google_fonts', $google_fonts_url, false, 1.0, 'all' ); $css_dependencies[] = 'alurra_google_fonts'; } } add_action( 'enqueue_block_editor_assets', 'alurra_block_editor_styles', 1, 1 ); endif; /* EEDITOR STYLES FOR THE CLASSIC EDITOR ==================================================== */ if ( ! function_exists( 'alurra_classic_editor_styles' ) ) : function alurra_classic_editor_styles() { $classic_editor_styles = array( '/css/classic-editor.css', ); // Retrieve the Google Fonts URL and add it as a dependency $google_fonts_url = alurra_fonts_url(); if ( $google_fonts_url ) { $classic_editor_styles[] = $google_fonts_url; } add_editor_style( $classic_editor_styles ); } add_action( 'init', 'alurra_classic_editor_styles' ); endif; /* REGISTER CUSTOM WIDGETS ==================================================== */ require( get_template_directory() . '/inc/widgets/alurra-recent-posts.php' ); if ( ! function_exists( 'alurra_register_widgets' ) ) : function alurra_register_widgets() { register_widget( 'Alurra_Recent_Posts' ); } add_action( 'widgets_init', 'alurra_register_widgets' ); endif; /* INCLUDES - ADDITIONAL FUNCTIONS & CLASSES ==================================================== */ // SVG Icons require get_template_directory() . '/inc/class-alurra-svg-icons.php'; // Function files require get_template_directory() . '/inc/template-tags.php'; require get_template_directory() . '/inc/template-functions.php'; require get_template_directory() . '/inc/sidebars.php'; require get_template_directory() . '/inc/inline-styles.php'; // Customizer require get_template_directory() . '/inc/customizer/custom-controls/custom-control.php'; require get_template_directory() . '/inc/customizer/customizer.php'; require get_template_directory() . '/inc/typography.php'; // Load theme structure require get_template_directory() . '/inc/layouts/header-layouts.php'; require get_template_directory() . '/inc/layouts/blog-layouts.php'; require get_template_directory() . '/inc/layouts/post-layouts.php';