esc_html__( 'Primary Menu', 'photomania' ), 'footer' => esc_html__( 'Footer Menu', 'photomania' ), 'social' => esc_html__( 'Social Menu', 'photomania' ), 'notfound' => esc_html__( '404 Menu', 'photomania' ), ) ); /* * 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', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'photomania_custom_background_args', array( 'default-color' => 'f6f6f6', 'default-image' => '', ) ) ); // Enable support for selective refresh of widgets in Customizer. add_theme_support( 'customize-selective-refresh-widgets' ); // Enable support for custom logo. add_theme_support( 'custom-logo' ); // Load default block styles. add_theme_support( 'wp-block-styles' ); // Add support for responsive embeds. add_theme_support( 'responsive-embeds' ); // Enable support for footer widgets. add_theme_support( 'footer-widgets', 4 ); // Load Supports. require get_template_directory() . '/inc/support.php'; global $photomania_default_options; $photomania_default_options = photomania_get_default_theme_options(); } endif; add_action( 'after_setup_theme', 'photomania_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 photomania_content_width() { $GLOBALS['content_width'] = apply_filters( 'photomania_content_width', 640 ); } add_action( 'after_setup_theme', 'photomania_content_width', 0 ); /** * Register widget area. */ function photomania_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Primary Sidebar', 'photomania' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here to appear in your Primary Sidebar.', 'photomania' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Secondary Sidebar', 'photomania' ), 'id' => 'sidebar-2', 'description' => esc_html__( 'Add widgets here to appear in your Secondary Sidebar.', 'photomania' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'photomania_widgets_init' ); /** * Enqueue scripts and styles. */ function photomania_scripts() { $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/third-party/font-awesome/css/font-awesome' . $min . '.css', '', '4.7.0' ); $fonts_url = photomania_fonts_url(); if ( ! empty( $fonts_url ) ) { wp_enqueue_style( 'photomania-google-fonts', $fonts_url, array(), null ); } wp_enqueue_style( 'jquery-sidr', get_template_directory_uri() .'/third-party/sidr/css/jquery.sidr.dark' . $min . '.css', '', '2.2.1' ); wp_enqueue_style( 'jquery-magnific-popup', get_template_directory_uri() .'/third-party/magnific-popup/css/magnific-popup' . $min . '.css', '', '1.1.0' ); wp_enqueue_style( 'photomania-style', get_stylesheet_uri(), null, date( 'Ymd-Gis', filemtime( get_template_directory() . '/style.css' ) ) ); wp_enqueue_script( 'photomania-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix' . $min . '.js', array(), '20130115', true ); wp_enqueue_script( 'jquery-cycle2', get_template_directory_uri() . '/third-party/cycle2/js/jquery.cycle2' . $min . '.js', array( 'jquery' ), '2.1.6', true ); wp_enqueue_script( 'jquery-sidr', get_template_directory_uri() . '/third-party/sidr/js/jquery.sidr' . $min . '.js', array( 'jquery' ), '2.2.1', true ); wp_enqueue_script( 'jquery-magnific-popup', get_template_directory_uri() . '/third-party/magnific-popup/js/jquery.magnific-popup' . $min . '.js', array( 'jquery' ), '1.1.0', true ); wp_enqueue_script( 'photomania-custom', get_template_directory_uri() . '/js/custom' . $min . '.js', array( 'jquery', 'wp-util', 'masonry' ), '1.0.0', true ); $custom_args = array( 'go_to_top_status' => ( true === photomania_get_option( 'go_to_top' ) ) ? 1 : 0, ); $custom_args['ajaxurl'] = admin_url( 'admin-ajax.php' ); wp_localize_script( 'photomania-custom', 'Photomania_Custom_Options', $custom_args ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'photomania_scripts' ); /** * Enqueue admin scripts and styles. */ function photomania_admin_scripts( $hook ) { $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; if ( in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) { wp_enqueue_style( 'photomania-metabox', get_template_directory_uri() . '/css/metabox' . $min . '.css', '', '1.0.0' ); wp_enqueue_script( 'photomania-custom-admin', get_template_directory_uri() . '/js/admin' . $min . '.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-tabs' ), '1.0.0', true ); } if ( 'widgets.php' === $hook ) { wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'wp-color-picker' ); wp_enqueue_media(); wp_enqueue_style( 'photomania-custom-widgets-style', get_template_directory_uri() . '/css/widgets' . $min . '.css', array(), '1.0.0' ); wp_enqueue_script( 'photomania-custom-widgets', get_template_directory_uri() . '/js/widgets' . $min . '.js', array( 'jquery' ), '1.0.0', true ); } } add_action( 'admin_enqueue_scripts', 'photomania_admin_scripts' ); if ( ! function_exists( 'photomania_blocks_support' ) ) : /** * Create add default blocks support */ function photomania_blocks_support() { // Add support for Block Styles. add_theme_support( 'wp-block-styles' ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); // Add support for editor styles. add_theme_support( 'editor-styles' ); // Add support for responsive embeds. add_theme_support( 'responsive-embeds' ); // Add custom editor font sizes. add_theme_support( 'editor-font-sizes', array( array( 'name' => esc_html__( 'Small', 'photomania' ), 'shortName' => esc_html__( 'S', 'photomania' ), 'size' => 14, 'slug' => 'small', ), array( 'name' => esc_html__( 'Normal', 'photomania' ), 'shortName' => esc_html__( 'M', 'photomania' ), 'size' => 18, 'slug' => 'normal', ), array( 'name' => esc_html__( 'Large', 'photomania' ), 'shortName' => esc_html__( 'L', 'photomania' ), 'size' => 42, 'slug' => 'large', ), array( 'name' => esc_html__( 'Huge', 'photomania' ), 'shortName' => esc_html__( 'XL', 'photomania' ), 'size' => 54, 'slug' => 'huge', ), ) ); // Add support for custom color scheme. add_theme_support( 'editor-color-palette', array( array( 'name' => esc_html__( 'White', 'photomania' ), 'slug' => 'white', 'color' => '#ffffff', ), array( 'name' => esc_html__( 'Black', 'photomania' ), 'slug' => 'black', 'color' => '#111111', ), array( 'name' => esc_html__( 'Gray', 'photomania' ), 'slug' => 'gray', 'color' => '#f4f4f4', ), array( 'name' => esc_html__( 'Blue', 'photomania' ), 'slug' => 'blue', 'color' => '#1b8be0', ), array( 'name' => esc_html__( 'Orange', 'photomania' ), 'slug' => 'orange', 'color' => '#ffc300', ), array( 'name' => esc_html__( 'Red', 'photomania' ), 'slug' => 'red', 'color' => '#f5245f', ), ) ); } add_action( 'after_setup_theme', 'photomania_blocks_support', 20 ); endif; //photomania_blocks_support if ( ! function_exists( 'photomania_add_blocks_style' ) ) : /** * Add Blocks Style */ function photomania_add_blocks_style() { // Theme block stylesheet. wp_enqueue_style( 'photomania-block-style', get_theme_file_uri( '/css/blocks.css' ), array( 'photomania-style' ), date( 'Ymd-Gis', filemtime( get_template_directory() . '/css/blocks.css' ) ) ); } add_action( 'wp_enqueue_scripts', 'photomania_add_blocks_style' ); endif; //photomania_add_blocks_style if ( ! function_exists( 'photomania_block_editor_styles' ) ) : /** * Enqueue editor styles for Blocks */ function photomania_block_editor_styles() { // Block styles. wp_enqueue_style( 'photomania-block-editor-style', get_theme_file_uri( '/css/editor-blocks.css' ), null, date( 'Ymd-Gis', filemtime( get_template_directory() . '/css/editor-blocks.css' ) ) ); // Add custom fonts. wp_enqueue_style( 'photomania-fonts', photomania_fonts_url(), array(), null ); } add_action( 'enqueue_block_editor_assets', 'photomania_block_editor_styles' ); endif; //photomania_block_editor_styles /** * Load init. */ require_once get_template_directory() . '/inc/init.php';