register_all_core_location(); } public static function post_class ( $classes ) { // Get post global $post; // Add entry class $classes[] = 'entry'; // Add has media class if ( has_post_thumbnail() || get_post_meta( $post->ID, 'kirhero_post_oembed', true ) || get_post_meta( $post->ID, 'kirhero_post_self_hosted_media', true ) || get_post_meta( $post->ID, 'kirhero_post_video_embed', true ) ) { $classes[] = 'has-media'; } // Return classes return $classes; } public static function custom_css ( $output = NULL ) { global $wp_customize; // Add filter for adding custom css via other functions $output = apply_filters( 'kirhero_css', $output ); if ( ! empty( $output ) ) { // Note that esc_html() cannot be used because `div > span` is not interpreted properly. (wordpress/wp-includes/theme.php) echo "\n"; } } static public function theme_setup () { global $content_width; // Load text domain load_theme_textdomain( 'astori', get_template_directory() .'/languages' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); // Enable support for Post Formats add_theme_support( 'post-formats', array( 'video', 'gallery', 'audio', 'quote', 'link' ) ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded 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 add_theme_support( 'post-thumbnails' ); //add_image_size( 'kirhero-small', 100, 70, array('center', 'center') ); add_image_size( 'kirhero-medium', 218, 150, array('center', 'center') ); add_image_size( 'kirhero-blog', 360, 240, array('center', 'center') ); // Register navigation menus register_nav_menus( array( //'topbar_menu' => esc_html__( 'Top Bar', 'astori' ), 'main_menu' => esc_html__( 'Main', 'astori' ), //'second_menu' => esc_html__( 'Second Menu', 'astori' ), 'footer_menu' => esc_html__( 'Footer', 'astori' ), ) ); /* * 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', ) ); add_theme_support( 'woocommerce' ); //add_theme_support('menus'); add_theme_support('drop-down-menu'); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // Add editor style add_editor_style( 'assets/css/editor-style.css' ); /** * 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, ) ); // Set content width based on theme's default design if ( !isset( $content_width ) ) { $content_width = 1200; } } public static function register_sidebars () { //register_sidebar( 'subscribe-widgets' ); } public static function kirhero_world ( ) { } public static function register_scripts () { $theme_version = self::theme_version (); wp_enqueue_style( 'kirhero-style', get_stylesheet_uri(), array(), $theme_version); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } wp_enqueue_script( 'kirhero-matchheight', get_template_directory_uri() . '/assets/js/alien/jquery.matchHeight.js', array( 'jquery' ), $theme_version, false ); wp_enqueue_script( 'kirhero-main', get_template_directory_uri() .'/assets/js/main.js', array( 'jquery' ), $theme_version, false ); //sidr wp_enqueue_script( 'Sidr', get_template_directory_uri() . '/assets/js/alien/jquery.sidr.min.js', '', $theme_version, false ); // Remove font awesome style from plugins wp_deregister_style( 'font-awesome' ); // Load font awesome style wp_enqueue_style( 'font-awesome', get_template_directory_uri() .'/assets/css/alien/font-awesome.min.css', false, '4.7.0' ); } public static function theme_version () { // Get theme data $theme = wp_get_theme(); // Return theme version return $theme->get( 'Version' ); } } $kirhero_theme_class = new Kirhero_Theme_Class; $kirhero_theme_settings_class = new Kirhero_Theme_Settings_Class; /** * Load Jetpack compatibility file. */ if ( defined( 'JETPACK__VERSION' ) ) { require get_template_directory() . '/inc/jetpack.php'; }