Default header image does not display

You should register the default headers using register_defaults_headers – e.g. register_default_headers( array( ‘default-image’ => array( ‘url’ => get_stylesheet_directory_uri() . ‘/assets/img/default-header.jpg’, ‘thumbnail_url’ => get_stylesheet_directory_uri() . ‘/assets/img/default-header.jpg’, ‘description’ => __( ‘Default Header Image’, ‘textdomain’ ) ), ) ); See the codex entry for more info on the function – https://codex.wordpress.org/Function_Reference/register_default_headers. The Codex isn’t clear, but this function … Read more

Panel description in Customizer does not show up

I needed to tweak the settings and controls code a bit to get them to work: $wp_customize->add_panel(‘mypanel’, array( ‘title’ => __(‘My awesome panel’, ‘domain’), ‘description’ => __(“This is the description which doesn’t want to show up :(“, ‘domain’), ‘capability’ => ‘edit_theme_options’, ‘priority’ => 2 )); $wp_customize->add_section(‘mysection’, array( ‘title’ => __(‘My even more awesome section’, ‘domain’), … Read more

How to set page template on front using starter content?

The reference to a post needs the item symbol within double curly braces: add_action(‘after_setup_theme’, function () { add_theme_support( ‘starter-content’, array( ‘posts’ => array( ‘home’ => array( // Use a page template with the predefined about page ‘template’ => ‘template-frontpage.php’, ), ), ‘options’ => array( ‘show_on_front’ => ‘page’, ‘page_on_front’ => ‘{{home}}’, ), )); }); And remember: … Read more

SSL: How to make customizer images Protocol Relative in WordPress?

I think the simpler solution would be to create your own function: function get_theme_mod_img($mod_name){ return str_replace(array(‘http:’, ‘https:’), ”, get_theme_mod($mod_name)); } then just use it: <a href=”https://wordpress.stackexchange.com/questions/256864/<?php echo esc_url(get_theme_mod(“slide_one_link’)); ?>”><img src=”<?php echo esc_url( get_theme_mod_img( ‘slide_img_upload_one’ ) ); ?>” alt=”<?php echo get_theme_mod( ‘slide_title_1’ ); ?>” /></a> there is another solution that involve filters as you can see … Read more

How to hide few theme customization options – TwentySeventeen theme

You can change active status of section using customize_section_active filter. It gives 2 parameters $active–bool and $section–object. Haven’t tried it so you can try and see if works for you. Located in \wp-includes\class-wp-customize-section.php, for your research. As second option you can try altering capability for the section. Note: I’m just giving options, and have not … Read more