400, 'width' => 600, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), ) ); // Title tag add_theme_support( 'title-tag' ); // Add nav menu register_nav_menu( 'primary-menu', __( 'Primary Menu', 'brunch-lite' ) ); register_nav_menu( 'secondary-menu', __( 'Secondary Menu', 'brunch-lite' ) ); register_nav_menu( 'footer-menu', __( 'Footer Menu', 'brunch-lite' ) ); // Add excerpts to pages add_post_type_support( 'page', array( 'excerpt' ) ); // HTML5 semantic markup add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); // Add Jetpack Infinite Scroll support add_theme_support( 'infinite-scroll', array( 'type' => 'click', 'footer' => false, 'footer_widgets' => false, 'container' => 'posts', 'render' => false, 'posts_per_page' => false, ) ); // Make the theme translation ready load_theme_textdomain( 'brunch-lite', get_template_directory() . '/languages' ); $locale_file = get_template_directory() . "/languages/" . get_locale(); if ( is_readable( $locale_file ) ) { require_once( $locale_file ); } } add_action( 'after_setup_theme', 'joy_setup' ); } /* ENQUEUE STYLES ------------------------------------------------ */ if ( ! function_exists( 'joy_load_style' ) ) { function joy_load_style() { if ( ! is_admin() ) { wp_enqueue_style( 'brunch-lite', get_template_directory_uri() . '/assets/css/brunch'.(!BRUNCH_DEV_MODE ? '.min' : '').'.css', array('brunch-fonts'), BRUNCH_VERSION ); wp_register_style( 'brunch-fonts', 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700', array(), null ); //https://fonts.googleapis.com/css?family=Lato:300,400,400i,700,700i,900,900i //wp_register_style( 'joy-fonts', 'https://fonts.googleapis.com/css?family=Lato:300,400,400i,700,700i,900,900i', array(), null ); } } add_action( 'wp_enqueue_scripts', 'joy_load_style' ); } /* DEACTIVATE DEFAULT WP GALLERY STYLES ------------------------------------------------ */ add_filter( 'use_default_gallery_style', '__return_false' ); /* ENQUEUE SCRIPTS ------------------------------------------------ */ if ( ! function_exists( 'joy_enqueue_scripts' ) ) { function joy_enqueue_scripts() { wp_enqueue_script( 'brunch-core', get_template_directory_uri() . '/assets/js/brunch-core'.(!BRUNCH_DEV_MODE ? '.min' : '').'.js', array( 'jquery', 'imagesloaded', 'masonry' ), BRUNCH_VERSION, true ); if (joy_option('image_lazyload', false) == true) { wp_enqueue_script( 'brunch-images-lazyload', get_template_directory_uri() . '/assets/js/lazyload'.(!BRUNCH_DEV_MODE ? '.min' : '').'.js', array( 'jquery' ), BRUNCH_VERSION, true ); } if ( ( ! is_admin() ) && is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if (is_single()) { $joy_has_postgallery = joy_has_post_gallery(get_the_ID(), 'featured_gallery'); if ($joy_has_postgallery['active']) { wp_enqueue_style( 'swiper', get_template_directory_uri() . '/assets/css/swiper.min.css', array(), BRUNCH_VERSION ); wp_enqueue_script( 'swiper', get_template_directory_uri() . '/assets/js/swiper.min.js', array( 'jquery' ), BRUNCH_VERSION, true ); } } else { if (joy_option('header_featured', false) == true && is_home()) { wp_enqueue_style( 'swiper', get_template_directory_uri() . '/assets/css/swiper.min.css', array(), BRUNCH_VERSION ); wp_enqueue_script( 'swiper', get_template_directory_uri() . '/assets/js/swiper.min.js', array( 'jquery' ), BRUNCH_VERSION, true ); } } } add_action( 'wp_enqueue_scripts', 'joy_enqueue_scripts' ); } /* MODIFY HTML CLASS TO INDICATE JS ------------------------------------------------ */ if ( ! function_exists( 'joy_has_js' ) ) { function joy_has_js() { ?> esc_html__( 'Post Sidebar', 'brunch-lite' ), 'id' => 'post-1', 'description' => esc_html__('Optional sidebar for posts. All widgets will appear if you choose to show sidebar on your posts.', 'brunch-lite'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Blog Sidebar', 'brunch-lite' ), 'id' => 'blog-1', 'description' => esc_html__('Optional sidebar for blogs and archives. All widgets will appear if you choose to show sidebar on your listings.', 'brunch-lite'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Full Width Footer Area', 'brunch-lite' ), 'id' => 'prefooter', 'description' => esc_html__('Full width sidebar area just before footer suitable for galleries or custom content. Example: Instagram Widget, Flickr Widget and etc.', 'brunch-lite'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer #1', 'brunch-lite' ), 'id' => 'footer-1', 'description' => esc_html__('Footer containing sidebar', 'brunch-lite'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer #2', 'brunch-lite' ), 'id' => 'footer-2', 'description' => esc_html__('Footer containing sidebar', 'brunch-lite'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer #3', 'brunch-lite' ), 'id' => 'footer-3', 'description' => esc_html__('Footer containing sidebar', 'brunch-lite'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'joy_widgets_init' ); /** * Enqueue Media Library Scripts */ function joy_wp_enqueue_media() { /* * Register the about-me.js here so we can upload images in the customizer */ if ( ! wp_script_is( 'joy-about-me-widget-admin', 'registered' ) ) { wp_register_script( 'joy-about-me-widget-admin', get_template_directory_uri() . '/includes/widgets/assets/js/about-me.js', array( 'media-upload', 'media-views', ) ); } wp_enqueue_script( 'joy-about-me-widget-admin' ); } add_action( 'wp_enqueue_media', 'joy_wp_enqueue_media' ); require get_template_directory() . '/includes/joy-loader.php'; ?>