0

I'm trying to figure out if it's possible to use the Customizer controls to create a "Designed By [name]" dropdown menu, and have it echo out the name of the person/group with their name as a link to that website 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 ?>

I want the output to be: Designed by Group 1.

For now, it currently outputs as: "Designed by group1" instead of "Designed by Group 1"... it's using the word before the => instead of the label after.

Any insight on how to make this work? Thank you for any help!

0

Change this

'group1' => __( 'Group 1', 'ctotheme' ),

To this

'Group 1' => __( 'Group 1', 'ctotheme' ),

The first text 'group1' is the value the second is the label for the select option

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.