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. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); add_image_size( 'blogmagazine-thumb-136x102', 136, 102, true ); add_image_size( 'blogmagazine-thumb-300x316', 340, 316, true ); add_image_size( 'blogmagazine-thumb-305x207', 305, 207, true ); add_image_size( 'blogmagazine-thumb-622x420', 622, 420, true ); add_image_size( 'blogmagazine-thumb-500x365', 500, 365, true ); add_image_size( 'blogmagazine-thumb-800x600', 800, 600, true ); $blogmagazine_image_src_set_option = get_theme_mod( 'blogmagazine_image_src_set_option', 'disable' ); $calculate_image_srcset_callback = ($blogmagazine_image_src_set_option=='enable') ? '__return_true' : '__return_false'; add_filter( 'wp_calculate_image_srcset', $calculate_image_srcset_callback ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'blogmagazine_top_menu' => esc_html__( 'Top Menu', 'blogmagazine' ), 'blogmagazine_primary_menu' => esc_html__( 'Primary Menu', 'blogmagazine' ), 'blogmagazine_footer_menu' => esc_html__( 'Footer Menu', 'blogmagazine' ) ) ); /* * 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 for Custom Logo. add_theme_support( 'custom-logo', array( 'width' => 300, 'height' => 45, 'flex-width' => true, ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'blogmagazine_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // WooCommerce Support if ( class_exists( 'WooCommerce' ) ) { add_theme_support( 'woocommerce' ); } } endif; add_action( 'after_setup_theme', 'blogmagazine_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 blogmagazine_content_width() { $GLOBALS['content_width'] = apply_filters( 'blogmagazine_content_width', 640 ); } add_action( 'after_setup_theme', 'blogmagazine_content_width', 0 ); /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Set the theme version * * @global int $blogmagazine_version * @since 1.0.0 */ function blogmagazine_theme_version() { $blogmagazine_theme_info = wp_get_theme(); $GLOBALS['blogmagazine_version'] = $blogmagazine_theme_info->get( 'Version' ); } add_action( 'after_setup_theme', 'blogmagazine_theme_version', 0 ); /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Add a pingback url auto-discovery header for singularly identifiable articles. */ function blogmagazine_pingback_header() { if ( is_singular() && pings_open() ) { echo ''; } } add_action( 'wp_head', 'blogmagazine_pingback_header' );