• Resolved CustomizrLuvr

    (@customizrluvr)


    WEBSITE

    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="https://www.tnuocca.com/buy/amazon">Amazon</option>
    <option value="https://tnuocca.com/buy/clash-of-clans">Clash of Clans</option>
    <option value="https://tnuocca.com/buy/craigslist">Craigslist</option>
    <option value="https://tnuocca.com/buy/ebay">Ebay</option>
    <option value="https://tnuocca.com/buy/fiverr">Fiverr (1)</option>
    <option value="https://tnuocca.com/buy/instagram/">Instagram</option>
    <option value="https://tnuocca.com/buy/league-of-legends">League of Legends</option>
    <option value="https://tnuocca.com/buy/minecraft/">Minecraft (6)</option>
    <option value="https://tnuocca.com/buy/pinterest">Pinterest</option>
    <option value="https://tnuocca.com/buy/reddit">Reddit (12)</option>
    <option value="https://tnuocca.com/buy/runescape">Runescape</option>
    <option value="https://tnuocca.com/buy/skype">Skype (1)</option>
    <option value="https://tnuocca.com/buy/slickdeals">Slickdeals (1)</option>
    <option value="https://tnuocca.com/buy/twitch">Twitch</option>
    <option value="https://tnuocca.com/buy/vine">Vine</option>
    <option value="https://tnuocca.com/buy/warrior-forum">Warrior Forum (1)</option>
    <option value="https://tnuocca.com/buy/world-of-warcraft">World of Warcraft</option>
    <option value="https://tnuocca.com/buy/youtube">Youtube</option>
    <option value="https://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)
  • Looks like you have fixed it. ??

    Thread Starter CustomizrLuvr

    (@customizrluvr)

    Unfortunately not. The homepage dropdown select must also appear in header on all pages except homepage.

    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;">

    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

    (@customizrluvr)

    RESULT

    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

    (@customizrluvr)

    OK we fixed the logo to have words underneath, and removed the tagline.

    Now the select box is pushing menu items down: SCREENSHOT

    Any idea how to keep them on the same line?

    Thank you

    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

    (@customizrluvr)

    Thank you ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Dropdown select box in header’ is closed to new replies.