Cannot Get Customizer To Display Custom Sections

Question

I have been working on this for a while now and just can’t seem to get my custom section to display in my Customizer. I just need a few basic settings and controls to run on my site, but it’s not happening with the below code:

<?php

//* Add custom sections and settings to the Admin Customizer
class UWM_Customizer {
    
    public function _construct() {
        add_action('customize_register', array($this, 'register_customize_sections'));
        }
        
        public function register_customize_sections ($wp_customize) {
            //Initialize section
            $this->homepage_image_section($wp_customize); 
        }
        
        //Homepage Image Selection
        private function homepage_image_section($wp_customize) {
            
            //New panel 
            $wp_customize->add_section('basic-homepage-image-section', array(
                'title' => 'Main Image',
                'description' => _('This is where you will add in the main image of the site')
                ) );
                
            //Add Homepage Image
            $wp_customize->add_setting('basic-main-homepage-image', array(
                'default' => '',
                'type' => 'theme_mod',
                'capability' => 'edit_theme_options'));
            
            $wp_customize->add_control(new WP_Customize_Cropped_Image_Control(wp_customize, 'basic-main-homepage-image-control', array(
                'label' => 'Image',
                'section' => 'homepage_image_section',
                'settings' => 'basic-main-homepage-image',
                'width' => 2500,
                'height' => 999,
                
                ) ));
            
        }
            
    
}

Any help you could offer would be greatly appreciated.

0
user2565143 1 year 2020-07-15T07:11:37-05:00 0 Answers 62 views 0

Leave an answer

Browse
Browse