WP customize_register for Title OR Text

/* Customizer API*/

functions.php
function customize_api($custom_val){
$custom_val->add_section('general_section',array(
'title' => 'General Options',
'priority' => 20
));


$custom_val->add_setting('copyright_text',array(
'default' => 'HKC',
'transport' => 'refresh'
));


$custom_val->add_control('copyright_text',array(
'section' => 'general_section',
'label' => 'Copyright Text',
'type' => 'text'
));
}

add_action('customize_register','customize_api');


index.php
<h1>Copyright : <?php echo get_theme_mod('copyright_text'); ?></h1>

Comments

Popular posts from this blog

Deploy laravel application to digital ocean droplet

WP register_post_type() with custom CMB2 meta box

Git post receive setup at server for git push to the production from local machine