How can I make wordpress dropdown custom links the $wp_customizer - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Friday, February 18, 2022

How can I make wordpress dropdown custom links the $wp_customizer

I'm working on a custom WordPress theme. I built the navigation links with the custom links option in the menus section. Which I did because, I passed an id to the <a href = '#contacts'> Contacts </a> link. So when the link is clicked the page auto-scrolls to the section with that id.

Now I have a button which I'm making dynamic in the WordPress with $wp_customize. And I need to change 'type' => 'dropdown-pages' to dropdown my custom links. Is this possible

Here's the code in my functions.php file

$wp_customize->add_setting('prioritydsgns_custom_header_button1_url');

$wp_customize->add_control( new WP_Customize_Control($wp_customize, 'prioritydsgns_custom_header_button1_url', array(
'label' => 'Button 1 Link',
'section' => 'prioritydsgns_custom_header',
'settings' => 'prioritydsgns_custom_header_button1_url',
'type' => 'custom-links'
)));


source https://stackoverflow.com/questions/71163261/how-can-i-make-wordpress-dropdown-custom-links-the-wp-customizer

No comments:

Post a Comment