WP Customizer select with multiple values for "Designed By"?
-
I’m trying to figure out if it’s possible to use the Customizer controls to create a “Designed By” dropdown menu, and have it echo out the name of the person/group with their name as a link in the footer. This is what I have in my customizer.php, but I’m not sure how to incorporate a URL:
// Add "Designed by" notification in footer $wp_customize->add_setting( 'powered_by', array( 'default' => 'Group 1', 'sanitize_callback' => 'sanitize_powered_by', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'powered_by', array( 'section' => 'footer_section', 'label' => __( 'Designed by' ), 'type' => 'select', 'priority' => 8, 'choices' => array( 'group1' => __( 'Group 1', 'ctotheme' ), 'group2' => __( 'Group 2', 'ctotheme' ), 'group3' => __( 'Group 3', 'ctotheme' ), 'group4' => __( 'Group 4', 'ctotheme' ) ) ) );
And I have this in my footer.php:
<?php if( get_theme_mod( 'hide_powered_by' ) == false) { ?> Designed by <a href="#" target="_blank"><?php echo get_theme_mod( 'powered_by' ); ?></a>. <?php } // end hide_powered_by if ?>
Also, in the echo, instead of saying “Designed by Group 1”, it says “Designed by group1″… it’s using the label instead of the value associated with the label and I can’t figure out why. Any help? I’m a beginner to intermediate at PHP. I assume this would be a multidimensional array, but I’m not sure that can be used here.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WP Customizer select with multiple values for "Designed By"?’ is closed to new replies.