1

I can't work out why this isn't displaying anything. The option appears in the appearance - customise menu, I input my settings and display using:-

<?php get_theme_mod( 'twitter' ); ?>
<?php get_theme_mod( 'facebook' ); ?>

But nothing comes out. Why?

function debut_theme_customizer( $wp_customize ) {

// Add Social Media Section
$wp_customize->add_section( 'social-media' , array(
    'title' => __( 'Social Media', '_s' ),
    'priority' => 30,
    'description' => __( 'Enter the URL to your account for each service for the icon to appear in the header.', '_s' )
) );

// Add Twitter Setting
$wp_customize->add_setting( 'twitter' , array( 'default' => '' ));
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'twitter', array(
    'label' => __( 'Twitter', '_s' ),
    'section' => 'social-media',
    'settings' => 'twitter',
) ) );

$wp_customize->add_setting( 'facebook' , array( 'default' => '' ));
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'facebook', array(
   'label' => __( 'Facebook', '_s' ),
    'section' => 'social-media',
    'settings' => 'facebook',
) ) );



}
add_action('customize_register', 'debut_theme_customizer');
1

You should do echo output:

<?php echo get_theme_mod( 'twitter' ); ?>
<?php echo get_theme_mod( 'facebook' ); ?>

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.