-1

Please find the below image. It will be more clear to understand my question.

enter image description here

I want to display the title that has been shown on above image in the Customizer.

How can I do that?

  • Hey hey, what have you tried so far and where exactly are you stuck? Please update your question for clarification. – leymannx Mar 29 at 18:14
0

You can create a Custom Control for WP Customizer and use it.
For example:

    class Sub_Section_Heading_Custom_Control extends WP_Customize_Control {

        //The type of control being rendered
        public $type = 'sub_section_heading';



        //Render the control in the customizer

        public function render_content() {

        ?>
            <div class="sub-section-heading-control">
                <?php if( !empty( $this->label ) ) { ?>
                    <h4 class="customize-control-title">
                          <?php echo esc_html( $this->label ); ?>
                    </h4>
                <?php } ?>

            </div>
        <?php
        }
    }

Add some CSS

.sub-section-heading-control 
    .customize-control-title{ 

   text-align: center;
   color: white;
   background-color: saddlebrown;
   padding: 10px;

    }

And add it to a section in Customizer:

$wp_customize->add_setting('heading_post_content', array()); // dummy

$wp_customize->add_control( new Sub_Section_Heading_Custom_Control( 
            $wp_customize, 'heading_post_content',
            array(
                'label'   => __( 'Post Content', 'your-text-domain' ), // Set heading text here
                'section' => 'post_single', // set section id here
            )
        ) );

It should look like this: Custom Heading in Customizer Section

I hope this helps.

  • Thanks alot. It helped me to provide my own concept. – EGWorldNP May 21 at 11:24
  • @EGWorldNP Glad to know that it helped you. Please mark this as your Accepted Answer to help other people searching for similar topic. Thanks. – Qaisar Feroz May 21 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.