Title: Dropdown select box in header
Last modified: August 31, 2016

---

# Dropdown select box in header

 *  Resolved [CustomizrLuvr](https://wordpress.org/support/users/customizrluvr/)
 * (@customizrluvr)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/dropdown-select-box-in-header/)
 * [WEBSITE](http://tnuocca.com)
 * We would like to insert a dropdown select box underneath the tagline, and to 
   the left.
 * We tried the following code, and it displays above the logo in center and links
   do not work:
 *     ```
       remove_all_actions('__header');
   
       add_action ('__header', 'my_custom_header_content');
       function my_custom_header_content () {
       ?>
       <form name="HomeSelectBox">
       <p style="text-align:center"><select style="outline:none" name="brand" size="1">
       <option value="#" selected disabled>Select account to buy:</option>
       <option value="" disabled>(alphabetical order)</option>
       <option value="" disabled></option>
       <option value="http://www.tnuocca.com/buy/amazon">Amazon</option>
       <option value="http://tnuocca.com/buy/clash-of-clans">Clash of Clans</option>
       <option value="http://tnuocca.com/buy/craigslist">Craigslist</option>
       <option value="http://tnuocca.com/buy/ebay">Ebay</option>
       <option value="http://tnuocca.com/buy/fiverr">Fiverr (1)</option>
       <option value="http://tnuocca.com/buy/instagram/">Instagram</option>
       <option value="http://tnuocca.com/buy/league-of-legends">League of Legends</option>
       <option value="http://tnuocca.com/buy/minecraft/">Minecraft (6)</option>
       <option value="http://tnuocca.com/buy/pinterest">Pinterest</option>
       <option value="http://tnuocca.com/buy/reddit">Reddit (12)</option>
       <option value="http://tnuocca.com/buy/runescape">Runescape</option>
       <option value="http://tnuocca.com/buy/skype">Skype (1)</option>
       <option value="http://tnuocca.com/buy/slickdeals">Slickdeals (1)</option>
       <option value="http://tnuocca.com/buy/twitch">Twitch</option>
       <option value="http://tnuocca.com/buy/vine">Vine</option>
       <option value="http://tnuocca.com/buy/warrior-forum">Warrior Forum (1)</option>
       <option value="http://tnuocca.com/buy/world-of-warcraft">World of Warcraft</option>
       <option value="http://tnuocca.com/buy/youtube">Youtube</option>
       <option value="http://tnuocca.com/buy/other">Other</option>
       </select> <input style="margin-top:-10px" type="button" name="test" value="Go!" onClick="go()"></p>
       </form> />
       <?php
       }
       ```
   
 * Anyone know a solution?
 * Thanks

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Menaka S.](https://wordpress.org/support/users/menakas/)
 * (@menakas)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/dropdown-select-box-in-header/#post-6905312)
 * Looks like you have fixed it. 🙂
 *  Thread Starter [CustomizrLuvr](https://wordpress.org/support/users/customizrluvr/)
 * (@customizrluvr)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/dropdown-select-box-in-header/#post-6905423)
 * Unfortunately not. The homepage dropdown select must also appear in header _**
   on all pages except homepage**_.
 *  [Menaka S.](https://wordpress.org/support/users/menakas/)
 * (@menakas)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/dropdown-select-box-in-header/#post-6905437)
 * Hi,
    Do try changing the initial part of your code to this. Two changes – first
   is the hook that you are using. Second is the select tag’s attribute.
 *     ```
       remove_all_actions('__after_logo');
       add_action ('__after_logo', 'my_custom_header_content');
       function my_custom_header_content () {
       ?>
       <form name="HomeSelectBox">
       <p style="text-align:center"><select style="outline:none" name="brand" size="1" onchange="location = this.options[this.selectedIndex].value;">
       ```
   
 *  [Menaka S.](https://wordpress.org/support/users/menakas/)
 * (@menakas)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/dropdown-select-box-in-header/#post-6905438)
 * Try this in the initial part of your code.
 *     ```
       remove_all_actions('__after_logo');
       add_action ('__after_logo', 'my_custom_header_content');
       function my_custom_header_content () {
       ?>
       <form name="HomeSelectBox">
       <p style="text-align:center"><select style="outline:none" name="brand" size="1" onchange="location = this.options[this.selectedIndex].value;">
       ```
   
 *  Thread Starter [CustomizrLuvr](https://wordpress.org/support/users/customizrluvr/)
 * (@customizrluvr)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/dropdown-select-box-in-header/#post-6905442)
 * [RESULT](http://i.imgur.com/s1sxdn7.jpg)
 * It changes page. Now we need it on left side of menu, below logo, and not on 
   the homepage (every other page of site is OK).
 * Also there is some code in top-left.
 * Any idea how to fix?
 * Thank you
 *  Thread Starter [CustomizrLuvr](https://wordpress.org/support/users/customizrluvr/)
 * (@customizrluvr)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/dropdown-select-box-in-header/#post-6905443)
 * OK we fixed the logo to have words underneath, and removed the tagline.
 * Now the select box is pushing menu items down: [SCREENSHOT](http://i.imgur.com/Sj6Yqje.jpg)
 * Any idea how to keep them on the same line?
 * Thank you
 *  [Menaka S.](https://wordpress.org/support/users/menakas/)
 * (@menakas)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/dropdown-select-box-in-header/#post-6905444)
 * Probably you can change the hook and add the dropdown as a menu item?
 *     ```
       add_filter('wp_nav_menu_items','my_custom_header_content', 10, 2);
       function my_custom_header_content ($content) {
       return '<form name="HomeSelectBox">
       ...
       </form> '.$content;
       }
       ```
   
 *  Thread Starter [CustomizrLuvr](https://wordpress.org/support/users/customizrluvr/)
 * (@customizrluvr)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/dropdown-select-box-in-header/#post-6905445)
 * Thank you 🙂

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Dropdown select box in header’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/customizr/4.4.24/screenshot.png)
 * Customizr
 * [Support Threads](https://wordpress.org/support/theme/customizr/)
 * [Active Topics](https://wordpress.org/support/theme/customizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/customizr/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/customizr/reviews/)

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [code](https://wordpress.org/support/topic-tag/code/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [form](https://wordpress.org/support/topic-tag/form/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [html](https://wordpress.org/support/topic-tag/html/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [page](https://wordpress.org/support/topic-tag/page/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [post](https://wordpress.org/support/topic-tag/post/)

 * 8 replies
 * 2 participants
 * Last reply from: [CustomizrLuvr](https://wordpress.org/support/users/customizrluvr/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/dropdown-select-box-in-header/#post-6905445)
 * Status: resolved