WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove search button - available help does not work (15 posts)

  1. derblauereiter
    Member
    Posted 7 years ago #

    Hello and thank you for taking the time to read this.

    I have a k2 blog at http://halcyonrealms.com

    I would like to have a search form without the "search" button and have followed the instructions as stated on this page :

    http://www.dagondesign.com/articles/wordpress-search-form-without-search-button/

    However, even after implementing the changes the button stubbornly refuses to disappear. Can anyone offer any help ?

    Any help at all would be greatly appreciated.

    regards,

  2. whooami
    Member
    Posted 7 years ago #

    widget:

    <div id="search" class="widget widget_search">
    <form id="searchform" method="get" action="http://halcyonrealms.com">
    <div>
    <input type="text" name="s" id="s" size="15" />
    <input type="submit" value="Search" />
    </div></form>

    and it doesnt look a bit like what's on that other site.

    1. are you using a widget? cuz thats a widget.
    2. are you using a cache plugin, like wp-cache?

  3. derblauereiter
    Member
    Posted 7 years ago #

    Thank you so much for the fast reply.

    I just found out it's a widget alright.

    How may I remove the search button in this case ?

  4. whooami
    Member
    Posted 7 years ago #

    :) I edited my post but you caught it before it changed :)

    If its a widget isnt it there listed in presentation --> widgets or whatever that page is?

  5. derblauereiter
    Member
    Posted 7 years ago #

    Hello. Yes its a widget named "search" and can be found under presentation >> widgets.

    However, it doesn't seem that I can edit it in anyway.

  6. whooami
    Member
    Posted 7 years ago #

    you dont edit it.. you drag it off the sidebar - the same way you drag on and off other widgets :)

  7. derblauereiter
    Member
    Posted 7 years ago #

    Hmm...maybe I'm lost here, but if I drag this widget off the search function disappears right ?

    Does it then mean that if I want a search function without the search button I will need a non-widget search ? How do I implement one ?

  8. whooami
    Member
    Posted 7 years ago #

    the default k2 install comes with a search, I see it in the sidebar.php inside the zip.

  9. whooami
    Member
    Posted 7 years ago #

    the default k2 sidebar includes a search, and its a widget:

    <?php /* Widgets/SBM Check */ if ( !(function_exists('dynamic_sidebar') and get_option('k2sidebarnumber') > 0 and dynamic_sidebar(1)) ) { ?>
    <div id="search"><h2><?php _e('Search','k2_domain'); ?></h2>
    		<?php include (TEMPLATEPATH . '/searchform.php'); ?>
    	</div>
    ...

    Im going to bet thats whats making your search. so I was right above 2x .. its a widget and its the k2 search.

    --

    What I would do is remove the widget and add the search out of the default theme to my sidebar.php. Then I would make the changes like you see on that other site. Maybe you can just copy that completely into your sidbar, I dunno, I didnt look that hard.

  10. derblauereiter
    Member
    Posted 7 years ago #

    Hello, I am going to try the changes that you have advised, thank you so much for your help ! I will post again to let you know if it went smoothly.

    Thank you so much again !

  11. derblauereiter
    Member
    Posted 7 years ago #

    Hello. I have tried to implement the changes but now my searchbar is not showing. This is what I have done.

    1) I removed the k2 search widget ( dragged it off )
    2) I removed this k2 search widget code from sidebar.php :

    <div id="search"><h2><?php _e('Search','k2_domain'); ?></h2>
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    </div>

    3) I added this search code from wordpress's default theme
    back into sidebar.php

    <?php include (TEMPLATEPATH . '/searchform.php'); ?>

    4) I changed the code for my searchform.php from the website in my first post.

    What did I do wrong ? Thank you so much for your help again !

  12. whooami
    Member
    Posted 7 years ago #

    hang on :) im doing it now ..

  13. whooami
    Member
    Posted 7 years ago #

    ok, heres my k2 sidebar.php:

    http://www.village-idiot.org/broke/sidebar.txt

    it looks like this:

    http://www.village-idiot.org/ bigboxasdfasdasd/

    the other thing I had to do was remove the call to the javascript inside header.php. Just remove this bit:

    if (get_option('k2livesearch') == 1) {
    		wp_enqueue_script('k2livesearch');
    	}

    once youve done that, then you can do those other changes.

    remove the spaces in that url if you want to see, I dont want that indexed by google so i broke it.

  14. derblauereiter
    Member
    Posted 7 years ago #

    Hello and thank you for investigating ! I will try to fix it again !

  15. derblauereiter
    Member
    Posted 7 years ago #

    Hello I have found a simple solution to remove the search button for the search widget :

    In the wp-includes folder ( in your wordpress installation folder ), open widgets.php and look for the wp_widget_search function definition block (around line 405 or so). Within the definition block, look for this line:

    <input type="submit" value="<?php echo attribute_escape(__('Search')); ?>" />

    Simply edit the "submit" and change it to "hidden", save, refresh your browser, and the submit button should be hidden now.

Topic Closed

This topic has been closed to new replies.

About this Topic