esc_html__( 'Main Menu', 'artpop' ), 'social_menu' => esc_html__( 'Social Menu', 'artpop' ), 'footer-menu' => esc_html__( 'Footer Menu', 'artpop' ), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption' ) ); // Set up the WordPress Custom Logo Feature. add_theme_support( 'custom-logo', array( 'height' => 600, 'width' => 400, 'flex-width' => true, 'flex-height' => true, ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // Add AMP support add_theme_support( 'amp' ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); // Add support for editor styles. add_theme_support( 'editor-styles' ); // Enqueue editor styles. add_editor_style( array( 'assets/css/editor-style.css', artpop_fonts_url() ) ); // Add custom editor font sizes. add_theme_support( 'editor-font-sizes', array( array( 'name' => __( 'Small', 'artpop' ), 'size' => 14, 'slug' => 'small', ), array( 'name' => __( 'Normal', 'artpop' ), 'size' => 16, 'slug' => 'normal', ), array( 'name' => __( 'Large', 'artpop' ), 'size' => 24, 'slug' => 'large', ), array( 'name' => __( 'Larger', 'artpop' ), 'size' => 32, 'slug' => 'larger', ), array( 'name' => __( 'Huge', 'artpop' ), 'size' => 48, 'slug' => 'huge', ), ) ); // Add support for custom color scheme. add_theme_support( 'editor-color-palette', array( array( 'name' => __( 'Accent Color', 'artpop' ), 'slug' => 'accent', 'color' => esc_attr( get_theme_mod( 'accent_color', artpop_defaults( 'accent_color' ) ) ), ), array( 'name' => __( 'Black', 'artpop' ), 'slug' => 'black', 'color' => '#000000', ), array( 'name' => __( 'Dark', 'artpop' ), 'slug' => 'dark', 'color' => '#2c2d2e', ), array( 'name' => __( 'Gray', 'artpop' ), 'slug' => 'gray', 'color' => '#4b4c4d', ), array( 'name' => __( 'Light Gray', 'artpop' ), 'slug' => 'light-gray', 'color' => '#9d9e9e', ), array( 'name' => __( 'White', 'artpop' ), 'slug' => 'white', 'color' => '#ffffff', ), ) ); } endif; add_action( 'after_setup_theme', 'artpop_setup' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. */ function artpop_content_width() { $content_width = $GLOBALS['content_width']; // Get layout. $site_home_sidebar = get_theme_mod( 'site_home_sidebar', artpop_defaults( 'site_home_sidebar' ) ); $site_archive_sidebar = get_theme_mod( 'site_archive_sidebar', artpop_defaults( 'site_archive_sidebar' ) ); $site_post_sidebar = get_theme_mod( 'site_post_sidebar', artpop_defaults( 'site_post_sidebar' ) ); if ( ! is_active_sidebar( 'sidebar-1' ) ) { $content_width = 1156; } elseif ( is_home() && ! $site_home_sidebar ) { $content_width = 1156; } elseif ( ( is_archive() || is_search() ) && ! $site_archive_sidebar ) { $content_width = 1156; } elseif ( is_single() && ! $site_post_sidebar ) { $content_width = 1156; } elseif ( is_page_template( 'templates/full-width.php' ) || is_page_template( 'templates/no-sidebar.php' ) ) { $content_width = 1156; } $GLOBALS['content_width'] = apply_filters( 'artpop_content_width', $content_width ); } add_action( 'template_redirect', 'artpop_content_width', 0 ); if ( ! function_exists( 'artpop_fonts_url' ) ) : /** * Register Google fonts. * * @return string Google fonts URL for the theme. */ function artpop_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; if ( 'off' !== _x( 'on', 'Inter: on or off', 'artpop' ) ) { $fonts[] = 'Inter:400,400i,700,700i'; } if ( 'off' !== _x( 'on', 'Quicksand: on or off', 'artpop' ) ) { $fonts[] = 'Quicksand:400,700'; } /* translators: To add an additional character subset specific to your language, translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. */ $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'artpop' ); if ( 'cyrillic' == $subset ) { $subsets .= ',cyrillic,cyrillic-ext'; } elseif ( 'greek' == $subset ) { $subsets .= ',greek,greek-ext'; } elseif ( 'devanagari' == $subset ) { $subsets .= ',devanagari'; } elseif ( 'vietnamese' == $subset ) { $subsets .= ',vietnamese'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), 'display' => 'fallback', ), 'https://fonts.googleapis.com/css' ); } return esc_url_raw( $fonts_url ); } endif; /** * Enqueue scripts and styles. */ function artpop_scripts() { // Add Google Fonts. wp_enqueue_style( 'artpop-fonts', artpop_fonts_url(), array(), null ); // Theme stylesheet. $theme_version = wp_get_theme()->get( 'Version' ); wp_enqueue_style( 'artpop-style', get_stylesheet_uri(), array(), $theme_version ); if( ! artpop_is_amp() ) { // Main js. wp_enqueue_script( 'artpop-script', get_template_directory_uri() . '/assets/js/main.js', array(), '20210913', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } // Add Swiper. if ( is_home() && get_theme_mod( 'home_show_featured_posts', artpop_defaults( 'home_show_featured_posts' ) ) && 'featured-carousel' == get_theme_mod( 'home_featured_posts_layout', artpop_defaults( 'home_featured_posts_layout' ) ) ) { wp_enqueue_style( 'artpop-swiper-style', get_template_directory_uri() . '/assets/css/swiper-bundle.min.css', array(), '6.1.2' ); wp_enqueue_script( 'artpop-swiper-script', get_template_directory_uri() . '/assets/js/swiper-bundle.min.js', array(), '6.1.2', true ); wp_add_inline_script( 'artpop-swiper-script', artpop_initialize_swiper() ); } } add_action( 'wp_enqueue_scripts', 'artpop_scripts' ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function artpop_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'artpop' ), 'id' => 'sidebar-1', 'description' => __( 'Add widgets here.', 'artpop' ), 'before_widget' => '', 'before_title' => '
'; echo $description; echo '
'; endif; } /** * Display the Search Icon. */ function artpop_search_popup() { if ( get_theme_mod( 'header_show_search_icon', 1 ) ) : if( ! artpop_is_amp() ) { echo '