'wp_head', 'wp_generator' => 'wp_head', 'wlwmanifest_link' => 'wp_head', 'rest_output_link_wp_head' => 'wp_head', 'rest_output_link_header' => 'template_redirect' ); } //It removes unnecessary actions foreach( eos_unnecessary_actions() as $callback => $action ){ remove_action( $callback,$action ); } /** * alma setup. * * Sets up theme defaults and registers the various supported WordPress features. * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To add a Visual Editor stylesheet. * @uses add_theme_support() To add support for post thumbnails, automatic feed links, * custom background, and post formats. * @uses register_nav_menu() To add support for navigation menus. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since alma 1.0 */ add_action( 'after_setup_theme', 'eos_load_theme_textdomain' ); //Loads theme text domain function eos_load_theme_textdomain() { load_theme_textdomain( 'bluelink', FALSE,EOS_TEMPLATE_DIRECTORY . '/locale' ); } add_filter( 'load_textdomain_mofile', 'eos_alma_load_custom_theme_translation_file', 10, 2 ); //Sets textdomain files function eos_alma_load_custom_theme_translation_file( $mofile, $domain ) { if ( 'bluelink' === $domain ) { $mofile = EOS_TEMPLATE_DIRECTORY . '/locale/alma-'.get_user_locale().'.mo'; } return $mofile; } //Theme setup add_action( 'after_setup_theme', 'eos_theme_setup' ); function eos_theme_setup(){ add_theme_support( 'align-wide' ); //For Gutenberg wide images // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => __( 'Primary Menu', 'bluelink' ) ) ); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support( 'post-thumbnails' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( "title-tag" ); add_theme_support( 'custom-header', array( 'width' => 980,'height' => 400,'flex-width' => true, 'flex-height' => true, 'random-default' => false, 'header-text' => false ) ); add_theme_support( 'custom-logo', array( 'height' => 100,'width' => 400,'flex-height' => true,'flex-width' => true )); add_theme_support( 'custom-background', array( 'default-color' => '#ffffff','default-position-x' => 'center', 'default-attachment' => 'scroll' ) ); set_post_thumbnail_size( 780, 9999 ); // Unlimited height, soft crop } add_action( 'after_setup_theme', 'eos_theme_setup' ); //Content width in case of full width pages function eos_content_width() { if ( is_attachment() ){ global $content_width; $content_width = 960; } } add_action( 'template_redirect', 'eos_content_width' ); if ( ! function_exists( 'wp_body_open' ) ) { /** * Fire the wp_body_open action. * * Added for backwards compatibility to support WordPress versions prior to 5.2.0. */ function wp_body_open() { /** * Triggered after the opening tag. */ do_action( 'wp_body_open' ); } } //load theme widgets add_action( 'widgets_init', 'eos_main_sidebar_widgets_init' ); /** * Register sidebars. * * Registers our main widget area and the front page widget areas. */ //Main sidebar function eos_main_sidebar_widgets_init() { register_sidebar( array( 'name' => __( 'Blog Sidebar', 'bluelink' ), 'id' => 'blog', 'description' => __( 'Appears on posts and blog page', 'bluelink' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Pages Sidebar', 'bluelink' ), 'id' => 'page', 'description' => __( 'Appears on pages when you chose a template including a sidebar', 'bluelink' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'wp_head','eos_add_inline_style' ); //It enqueues the theme style function eos_add_inline_style(){ require is_rtl() ? EOS_TEMPLATE_DIRECTORY.'/inc/style-rtl.php' : EOS_TEMPLATE_DIRECTORY.'/inc/style.php'; $style = eos_compress_css( apply_filters( 'bluelin_inline_style',$style ) ); echo ''; } //Returns a first level of compression given the CSS, it will strip comments and not useful spaces function eos_compress_css( $css ){ if( $css !== '' ){ $css = preg_replace( '/\/\*(.*?)\*\//','', $css ); $replace = array( "url()" => 'none', " " => " ", " " => " ", "/\/\*(.*?)\*\//" => '', "/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/" => '', ": " => ":", " :" => ":", "; " => ";", " ;" => ";", " {" => "{", " }" => "}", ", " => ",", " ," => ",", "{ " => "{", ";}" => "}", "} " => "}", "!important" => " !important", " !important" => " !important", ); $search = array_keys( $replace ); $css = str_replace( $search, $replace, $css ); } $css = str_replace( ' ',' ',str_replace( ' ',' ',$css ) ); return strip_tags( $css ); } add_action( 'admin_init', 'eos_add_editor_styles' ); //Registers an editor stylesheet for the theme. function eos_add_editor_styles() { add_editor_style( 'editor-style.css' ); }