Saturday, July 11, 2020
Wordpress HooksWordpress Tricks

How to add more panel or section into your WordPress customizer?

How to add custom meta title and meta description in Wordpress?

add more panel or section into your Wordpress customizer


Hello, welcome to In this post, I will tell you How to add more panel or section into your WordPress customizer? WordPress is the best cms. WordPress hooks(add_action, add_filter) give us the power to edit or change the code without interruption into the files and this is the best thing about wordpress.

WordPress give customizer options to make dynamic content add and edit easily for anyone and here is working example of it.

Here is code add more panel or section into your WordPress customizer and you need to add this code into your theme’s functions.php file:
function my_customize_register( $wp_customize ) {
            'label'      => 'Footer Copyright Text',
            'section'    => 'theme_setting',
            'settings'   => 'footercopyright',
            'type'		 => 'textarea'
       new WP_Customize_Image_Control(
               'label'      => __( 'Upload a logo', 'els' ),
               'section'    => 'theme_setting',
               'settings'   => 'logoimage'
add_action( 'customize_register' , 'my_customize_register' );

 After added above code, you can new sections into your wordpress customize section( Footer Copyright text and Upload A logo) and for get all values you need to add below code into your theme’s php template file:

<span><?php echo get_option('footercopyright'); ?></span>

<?php if(get_option('logoimage') != ""){ ?>
               <a href="<?php echo site_url(); ?>">
                <img src="<?php echo get_option('logoimage'); ?>" alt="#"/>
              <?php } ?>

 That is it.

There are so many tricks in wordpress and I will let you know all. Please do comment if you any query related to this post. Thank you.

Ajay Malhotra
the authorAjay Malhotra
Hello to all. Welcome to Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know Wordpress, Core php, Angularjs, Angular 2, Angular 6, Angular 7, Angular 8, Angular 9, Angular 10 Nodejs, laravel, Codeigniter, Shopify, Squarespace, Jquery, Google Map Api, Vuejs, Reactjs, Bigcommerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.