tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); add_theme_support( 'automatic-feed-links' ); // rss feederz /** * Enable support for Post Thumbnails on posts and pages. * wp thumbnails (sizes handled below) * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 400, 300, true ); // new default thumb size // new featured image name. width, height, and crop add_image_size( 'appeal-featured', 400, 300, false); // 4:3 ratio add_theme_support( 'post-formats', array( 'image', 'gallery' ) ); //page background image and color support $defaults = array( 'default-color' => '#fcfcfc', 'default-image' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); add_theme_support( 'custom-background', $defaults ); add_theme_support( 'custom-logo' ); add_editor_style('editor-style.css'); // main nav in header - also nav menu in footer and modal are same register_nav_menus( array( 'primary' => __('Main Menu Top', 'appeal'), 'above_footer' => __('Footer Links ~ 1 level ONLY', 'appeal') ) ); load_theme_textdomain( 'appeal', get_template_directory_uri() . '/languages' ); /** * Implementation of the Custom Header feature. * * @link https://developer.wordpress.org/themes/functionality/custom-headers/ * * @uses appeal_header_style() */ add_theme_support( 'custom-header', apply_filters( 'appeal_custom_header_args', array( 'default-image' => get_template_directory_uri() . '/assets/appeal-default-header-img.png', 'default-text-color' => '0000a0', 'width' => 1000, 'height' => 250, 'flex-height' => true, 'flex-width' => true, 'wp-head-callback' => 'appeal_theme_header_style', ) ) ); /** * Register Default Headers * @since 1.1.1 * https://codex.wordpress.org/Function_Reference/register_default_headers * https://generatewp.com/snippet/OvG9wDA/ updated * Left @string $parenturl to adjust for child theme */ $parenturl = get_template_directory_uri(); $suggested_imgs = array( 'appeal_tokyo' => array( 'description' => __( 'Tokyo', 'appeal' ), 'url' => $parenturl . '/assets/appeal-default-header-img.png', 'thumbnail_url' => $parenturl . '/assets/appeal-default-header-img-small.png', ), ); register_default_headers( $suggested_imgs ); //woocommerce filters below setup add_theme_support( 'woocommerce' ); } add_action('after_setup_theme','appeal_theme_setup'); /** * only enable js if the visitor is browsing either a page or a post * or if comments are open for the entry, or threaded comments are enabled */ function appeal_theme_queue_js(){ if ( (!is_admin()) && is_singular() && comments_open() && get_option('thread_comments') ) wp_enqueue_script( 'comment-reply' ); } add_action('wp_print_scripts', 'appeal_theme_queue_js'); /** * 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 appeal_content_width() { $GLOBALS['content_width'] = apply_filters( 'appeal_content_width', 740 ); } add_action( 'after_setup_theme', 'appeal_content_width', 0 ); // Register the custom image size for use in Add Media library. add_filter( 'image_size_names_choose', 'appeal_custom_thumb_sizes' ); function appeal_custom_thumb_sizes( $sizes ) { return array_merge( $sizes, array( 'appeal-featured' => __( 'Four by Three Ratio Thumb', 'appeal' ), ) ); } /** * Enqueue scripts and styles. */ function appeal_theme_scripts() { // For use of child themes wp_enqueue_style( 'appeal-style', get_stylesheet_uri() ); wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/bootstrap.js', array ( 'jquery' ), '3.3.7', true); wp_enqueue_script( 'appeal', get_template_directory_uri() . '/assets/appeal.js', array ( 'jquery' ), '', true); //enqueue (sane and include) scripts into WP wp_enqueue_style( 'appeal-google-fonts'); } add_action( 'wp_enqueue_scripts', 'appeal_theme_scripts' ); /** * Apply theme's stylesheet to the visual editor. * * @uses add_editor_style() Links a stylesheet to visual editor * @uses get_stylesheet_uri() Returns URI of theme stylesheet */ // Add Google Scripts for use with the editor if ( ! function_exists( 'appeal_mce_google_fonts_styles' ) ) { function appeal_mce_google_fonts_styles() { $font_url = 'https://fonts.googleapis.com/css?family=Raleway'; add_editor_style( str_replace( ',', '%2C', esc_url( $font_url ) ) ); } } add_action( 'init', 'appeal_mce_google_fonts_styles' ); /* * Translators: If there are characters in your language that are not * supported by Raleway, translate this to 'off'. Do not translate * into your own language. */ function appeal_fonts_url() { $fonts_url = ''; $Raleway = _x( 'on', 'Raleway font: on or off', 'appeal' ); if ( 'off' !== $Raleway ) { $font_families = array(); if ( 'off' !== $Raleway ) { $font_families[] = rawurlencode( 'Raleway' ); } $protocol = is_ssl() ? 'https' : 'http'; $query_args = array( 'family' => implode( '|', $font_families ), 'subset' => rawurlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ); } return esc_url( $fonts_url ); } /** * Loads custom font CSS file. * * To disable in a child theme, use wp_dequeue_style() * function mytheme_dequeue_fonts() { * wp_dequeue_style( 'appeal-fonts' ); * } * add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 ); * * @return void */ function appeal_fonts() { $fonts_url = appeal_fonts_url(); if ( ! empty( $fonts_url ) ) { wp_enqueue_style( 'appeal-fonts', esc_url_raw( $fonts_url ), array(), null ); } } add_action( 'wp_enqueue_scripts', 'appeal_fonts' ); /** * page excerpt support * @init * @add_post_type_support */ function appeal_theme_excerpt_support() { add_post_type_support( 'page', 'excerpt' ); } add_action( 'init', 'appeal_theme_excerpt_support' ); /** * support for logo upload, output. * Output sanitized in header to assure all html displays. * @since 1.1.8 */ function appeal_theme_custom_logo() { $output = ''; if ( function_exists( 'the_custom_logo' ) ) { $custom_logo_id = get_theme_mod( 'custom_logo' ); $logo = wp_get_attachment_image_src( $custom_logo_id , 'full' ); if ( has_custom_logo() ) { $output = '