WordPress.org

Ready to get started?Download WordPress

Forums

WP-TopBar
[resolved] Add wp search box in top bar (9 posts)

  1. rcaba002
    Member
    Posted 11 months ago #

    Hello,

    How do I add a search box to the right side of the top bar? I tried adding get_search_form(); in the PHP tab and it shows in the live preview but when I go to my site, the entire top bar is gone.

    Thanks,

    http://wordpress.org/plugins/wp-topbar/

  2. Bob
    Member
    Plugin Author

    Posted 11 months ago #

    What is your website URL? There is usually a java error that you can see from the developer tools.

  3. rcaba002
    Member
    Posted 11 months ago #

  4. Bob
    Member
    Plugin Author

    Posted 11 months ago #

    Odd beans... I don't see any related errors. (You should fix the errors that are present though).

    Can you email me a SQL export of your TopBar? I'll load it on my site to see what is wrong. My address is in the wp-topbar.php file.

    Thanks,

    Bob

  5. rcaba002
    Member
    Posted 11 months ago #

    I just sent it to you. Thanks!

  6. Bob
    Member
    Plugin Author

    Posted 11 months ago #

    It is because JavaScript has a hard time dealing with newline characters when using the prepend function used to cache the script.

    Try this instead of the PHP value you have:

    echo '<input type="text" name="s" id="s" placeholder="Search">';

  7. rcaba002
    Member
    Posted 11 months ago #

    Looks good. Thanks!

    But it's not functional. Am I missing something? I'm not that advanced.

  8. Bob
    Member
    Plugin Author

    Posted 11 months ago #

    Hmm..

    Try this:

    ?><form method="get" id="searchform" action="<?php bloginfo('home'); ?>/"><div><input type=”text” value="<?php the_search_query(); ?>" name="s" id="s" /><input type="submit" id="searchsubmit" value="Search" /></div></form><br /><?php

    It has to be all one line -- no newlines/enter characters.

    Bob

  9. Bob
    Member
    Plugin Author

    Posted 10 months ago #

    Closed - no response in a week.

Reply

You must log in to post.

About this Plugin

About this Topic