• I love the style of the default kubrick search, like: https://managedtasks.com/wpthemes/blog/ w/ a search FORM + search BUTTON on one-line.

    However, I need to use widgets. The search widget displays the search box + button differently.

    I edited my style.css to take away the padding style, from:

    #searchform {
    margin: 10px auto;
    padding: 5px 3px;
    text-align:center;
    }

    to

    #searchform {
    margin: 10px auto;
    padding: 0px;
    }

    … but i still cannot achieve the desired effect.

    Any help would be greatly appreciated, I really truly have tried to search as hard as I can, and have even contacted some blog owners, w/ no results. ??

    Thanks everyone!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter awsnap97

    (@awsnap97)

    anyone?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Without actually seeing your page, it’s extremely hard to tell you what changes to make to the CSS file.

    Post a link to the page in question.

    Greetings!

    Perhaps a bit late, but since I stumbled upon this lately, I suppose you could use some info in this post (https://appneed.com/corp/2008/03/13/customise-search-widget/)

    They use another theme, but the same reason apply: The search widget simply lacks certain attributes compared to other widgets, they need to be there in order for you to style them…

    Cheers!

    //ZM

    I have no idea why this isn’t changed so that they both look the same. Seems strange to me. I may try submitting my first patch, but I’m not entirely sure of the process.

    My fix was simple:

    Edit wp-includes/widgets.php

    find the “wp_widget_search($args)” function, delete the following lines:

    <form id="searchform" method="get" action="<?php bloginfo('home'); ?>">
    <div>
    <input type="text" name="s" id="s" size="15" />
    <input type="submit" value="<?php echo attribute_escape(__('Search')); ?>" />

    and add these in place (copied from the default theme’s searchform.php :

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

    Note: I am using 2.5 RC1.1 so it might be different, but this should give you an idea anyway.

    Phocks, you could have accomplished that in the theme’s function.php by overriding the code in the search widget. It’s safer to do it this way since the theme files don’t get overwritten when you upgrade wordpress. Details here:

    https://automattic.com/code/widgets/api/

    It is possible for theme authors to define replacement widgets within functions.php. Replace an existing widget by registering its name with a new callback. An empty callback will unregister a widget.
    Because each widget has a unique name and a non-unique callback, the default markup before a widget looks like this:

    <li id="{name}" class="{callback}">{callback output}</li>

    When you register a widget you may pass a custom classname to replace callback. This is most useful for object-oriented widgets whose callbacks are passed as arrays.

    Thanks kickass, it looks like someone has submitted a patch that should make the widget look for a searchform.php file in the templates dir and use that if found.

    https://trac.www.ads-software.com/ticket/5567

    Will probably be implemented in 2.6

    The widget override is a great idea, but I had a little trouble working out how to do it properly. I’ll try again when I have time.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘default WIDGET search box to the NON-widget one line search box button display’ is closed to new replies.