add_theme_support( ‘custom-header’ ) does not add option menu in dashboard

From Codex: If attached to a hook, it must be after_setup_theme. The init hook may be too late for some features. Try this if ( ! function_exists( ‘mytheme_setup’ ) ): function mytheme_setup() { add_theme_support( ‘custom-header’ ); } endif; add_action( ‘after_setup_theme’, ‘mytheme_setup’ ); If you use Toolbox Theme, find in functions.php function toolbox_setup() { and add … Read more

add_theme_support using a plugin

Figured it out after playing with Rarsts answer here. Here is what I ended up with: <?php /* Plugin Name: Bootstrap Genesis Addons Plugin URI: https://github.com/bryanwillis/bootstrap-genesis-addons Description: A collection of mini plugins/addons to apply specific changes to my site. Version: 1.0 Author: Bryan Willis Author URI: https://github.com/bryanwillis/ License: MIT License License URI: http://opensource.org/licenses/MIT */ function … Read more

Add theme support for post thumbnails

What add_theme_support( ‘post-thumbnails’, array( ‘products’ ) ); did is: it added the support for the post-thumbnail feature, and with the second parameter you fixed the feature support to only post_type = ‘products’. But it actually saying: Ok, load all the necessary things to register a Post Thumbnail — you’re actually introducing ‘Post Thumbnail’ to WordPress. … Read more

add_theme_support(‘my-custom-feature’)

You have to register the sidebars in the parent theme just late later enough. Use a hook that runs later, and child themes can register their theme support. Child theme add_action( ‘after_setup_theme’, ‘register_header_sidebar_support’ ); function register_header_sidebar_support() { return add_theme_support( ‘header-sidebar’ ); } Parent theme add_action( ‘wp_loaded’, ‘register_theme_sidebars’ ); function register_theme_sidebars() { if ( current_theme_supports( ‘header-sidebar’ … Read more

how to pull images with no add_theme_support(‘post_thumbnails’)

If you don’t want to modify the theme or add a child theme to handle post thumbnail support, you can do it via a plugin by attaching a callback to the after_setup_theme hook: <?php /* Plugin Name: WPSE Post Thumbnail Support Plugin URI: Description: Adds post thumbnail support to theme. Version: 0.0.1 Author: Author URI: … Read more

Override image maximum width in theme (Using Gutenberg editor)

add_theme_support(‘gutenberg’, [‘wide-images’ => true ]) is telling gutenberg, hey this sites content area’s CSS is setup to handle wide images. The theme_support wide-images code isn’t a magic fix – instead it’s an aknowledgment from the theme developer to gutenberg, that the themes CSS’s ready for gutenberg wide content. — If you’re just experimenting, and only … Read more

REQUIRED: The theme must not used the tags. | REQUIRED: The theme must not call to wp_title()

WordPress added support for the title-tag feature in version 4.1 and it’s now a required feature for themes uploaded to the repo. To implement this feature, make sure your theme does not have the title tag hard coded within header.php, e.g.: <title><?php wp_title( ‘|’, true, ‘right’ ); ?></title> Configure your theme with title-tag support like … Read more

add image size still doesn’t work even after regenerating thumbnails

There are a couple of things to check here. First, make sure that add_theme_support( ‘post-thumbnails’ ) is loaded before add_image_size( ‘small-thumb’, 60, 60, true ) You can always hook everything through a function to the after_setup_theme hook. I always add these in my theme setup function function wpse_setup_theme() { add_theme_support( ‘post-thumbnails’ ); add_image_size( ‘small-thumb’, 60, … Read more

Add colors to existing color palette without replacing it

You can merge palettes $existing = get_theme_support( ‘editor-color-palette’ ); $new = array_merge( $existing[0], array( array( ‘name’ => __( ‘Strong magenta’, ‘themeLangDomain’ ), ‘slug’ => ‘strong-magenta’, ‘color’ => ‘#a156b4’, ), array( ‘name’ => __( ‘Light grayish magenta’, ‘themeLangDomain’ ), ‘slug’ => ‘light-grayish-magenta’, ‘color’ => ‘#d0a5db’, ), )); add_theme_support( ‘editor-color-palette’, $new);