WordPress.org

Ready to get started?Download WordPress

Forums

Two Search Bars (9 posts)

  1. Spiritualight
    Member
    Posted 3 years ago #

    Hi

    I'm using the wordpress search function well and have a search bar in my sidebar.

    What I would like is a larger search bar on my home page. However everytime I edit the css size etc for the large search bar, my sidebar searchbar also obviously changes.

    Is there a way to have both search bars with different sizes etc? If so does anyone know how to manipulate the code/css to achieve this?

    Hope that makes sense!

    Thanks

  2. randinicole
    Member
    Posted 3 years ago #

    .searchbar1

    .searchbar2

    Give the search bar different ID so you can style with individual css.

    1
    <form method=”get” id=”search1” action=”<?php bloginfo(‘home’); ?>/”>
    <div><input type=”text” size=”″ value=” ” name=”” id=”” />
    <input type=”submit” id=”searchsubmit” value=”Search” class=”” />
    </div>
    </form>
    2
    <form method=”get” id=”search2” action=”<?php bloginfo(‘home’); ?>/”>
    <div><input type=”text” size=”″ value=” ” name=”” id=”” />
    <input type=”submit” id=”searchsubmit” value=”Search” class=”” />
    </div>
    </form>
  3. Spiritualight
    Member
    Posted 3 years ago #

    that sounds like a good idea..lol

    any idea how I go about that randinicole? :)

  4. randinicole
    Member
    Posted 3 years ago #

    Will look like something along the lines of what I posted. I did not get into specifics because I do not use the search function much but that should work.

    give em an id="tag" and css like this

    #search1

    #search2

  5. Spiritualight
    Member
    Posted 3 years ago #

    Thanks for your VERY quick response nicole!

    This is the code Im using to call the search bar on the home page,<form id="searchform" method="get" action="<?php bloginfo('siteurl')?>/index.php"><input type="text" "value="Search this site" onblur="if(this.value == '') {this.value = 'Search this site';}" onfocus="if(this.value == 'Search this site') {this.value = '';}" name="s" id="s" size="45" /> <input type="submit" value="Search" class="submit" name="searchsubmit"/></form>

    And Ive checked the widget code too on my sidebar searchbar, and they both call "searchform" - only thing is I don't have a searchform.php - I only have a search.php... am I missing something?

  6. randinicole
    Member
    Posted 3 years ago #

    The name is randi lol...... nicole is my middle name and I have no idea.......

    I have no clue what your theme looks like. Perhaps someone else will be able to help you with this better.

    Change the name of your searchsumbit input (for the home page) and code it out with css like I said. It should work just fine.

    Besides the style are they both working fine?

    This might help you

    http://codex.wordpress.org/Styling_Theme_Forms

  7. Spiritualight
    Member
    Posted 3 years ago #

    Oops sorry about the name!! hehe

    Actually Im getting page not found with the home page search bar! Hmmmm...

    I'm using ithemes blue essence as my theme. I think i may have to start over here and go through your suggestions 'slowly'

    Thanks again :)

  8. randinicole
    Member
    Posted 3 years ago #

    Well good luck, hopefully you get it figured out. Go through the codex and focus on the search element.

    As I said I do not know much about it so its hard for me to say.

  9. Spiritualight
    Member
    Posted 3 years ago #

    Cheers Randi! :)

Topic Closed

This topic has been closed to new replies.

About this Topic