• Hi there!

    I am generally quite new to WordPress. As you can see – this is my first post! (Hope I get some replies!)

    Because of the nature of the website I am building for a client’s business, they do not want the search function in the top right of the website. They’d rather have their contact details up there.

    I have tried to ‘comment out’ the search form but all my methods are breaking the other parts of the site.

    Would anyone be able to tell me how to delete the search bar and where to insert the code to insert a picture or text for putting something else there, like contact details.

    I look forward to your replies!

    Thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The search bar is usually a widget and you can remove it from the sidebar, but if nothing else is in the sidebar, it will still show up, so you may have to put a text widget in the sidebar and leave it empty of text.

    I am also new and this is something I read somewhere else and it worked for me to get a blank sidebar.

    The search bar in the header can probably be removed by opening header.php, and just commenting out lines 76-78 like this;

    <!– <div id=”top_search”>
    <?php get_search_form(); ?>
    </div> –>

    Keep an eye out for any side effects in the layout.

    Thread Starter preet996

    (@preet996)

    @edwardbe: Thank you. I have come across this before where the search bar is a widget and if you don’t insert anything on the sidebar or the header widget, then the search bar will automatically be there. However, just for your information, for the delicate theme specifically, it’s imbedded into the website, so it’s ClaytonJames’ solution which worked.

    @claytonjames: Thank you! I was specifically looking for the answer you gave me. I REALLY appreciate that and so quickly too. I hope in the near future, I can give back to the community! When I was trying to ‘comment out’ parts of the php files, I was typing “<?– ….. –>” instead of “!”, so that’s probably why it was failing on me! Not used to php yet!

    Thank you very much again! ??

    Kind regards and happy WordPressing!

    Thread Starter preet996

    (@preet996)

    Oh! Another quick question!

    Now that’s I’ve got rid of the search bar and hopefully there won’t be any side affects, could you show me what code to put in to quickly stick in a bit of text or a picture in that area so, just for a simple contact details kind of thing – name,number,email!…

    Thanks! ??

    Let’s backtrack a little, and use an image example.

    Quick and dirty, let’s try this. Instead of commenting out everything on lines 76-78, change it to this by just removing the search form, and save;

    <div id="top_search">
    
    </div>

    Now open the style sheet and find line 150.

    #top_search {height:25px; position:absolute; right:30px; top:50px; width:370px;}

    Let’s use an example of an image that’s 400×75. upload the image to the images folder in the theme directory, and change line 150 to this;

    #top_search { background:url(images/your_image.jpg) no-repeat; height:75px; position:absolute; right:30px; top:25px; width:400px;}

    I think that might work. Adjust to suit your needs of course. Or you could rename the #top_search div in header.php, and then place your own descriptions for the new div in the style sheet.

    [edit] if you want to add text,

    <div id="top_search">
    <p> Your hard coded text goes here </p>
    </div>

    …and I think you you will need to describe “p” in the style sheet using
    #top_search p { }

    Thread Starter preet996

    (@preet996)

    Thank you very much! Again, this is exactly the kind of information I was looking for. It would have probably taken me forever to find all of that over a number of forums, research and trial and error.

    I will give those examples a shot. I managed to follow along with your coding and logic, but I’m sure it’ll be a different story implementing it.

    Thank you, nevertheless. You have been very kind.

    I trust I’ll be in touch in the near future!

    You’re welcome! I hope it works for you.

    Thread Starter preet996

    (@preet996)

    Hey!
    It did work thank you and now I’m back for more! (Although not sure if anyone will receive an email on this matter!)

    I wanted to put another picture under it and make it a link. I tried to put it under the same top_search function and just move the picture down but that didn’t work.

    I ALMOST have it working.

    In the stylesheet, I made a function and it is as follows:

    #fb_link { background:url(images/findusonfacebook.jpg) no-repeat; height:44px; position:absolute; right:0px; top:50px; width:144px;}

    Then, in the header.php file, I have the following coding in:

    <div id="header">
    		<div id="flash_header">[kml_flashembed movie="https://www.******.co.uk/logo1.swf" height="120" width ="550"/]</div>
      <div id="top_search">
      <div id="fb_link"><a href="https://facebook.com/profile.php?id=100001659694965" target="_blank"><img src="https://www.*******/images/findusonfacebook.jpg"/>
    </div>
    </div>
    </div>

    It all works – the picture below the contact details is a link. BUT the problem is, the link appears on the line under the picture too, cutting into the nav bar, so it’s moved the HOME button on the nav bar down, so it’s not inline with the other links and so it’s a bit screwed up.

    Any support on this matter?

    Hope to hear from someone!

    Thanks! ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Delicate Theme NattyWP – How do you get rid of the search bar?’ is closed to new replies.