Forums

Is Search Bar hardcoded in free theme? (2 posts)

  1. TivoTron
    Member
    Posted 2 years ago #

    Hi there! I am playing with various free themes and debating whether I need a search bar on my blog. From my various searches, it appears that removing the search bar often depends on whether it is hardcoded into the theme itself.

    Two questions:

    1) How can I check if it's hardcoded?
    2) If it's not, how would I remove it?

    Thanks!!!

  2. Jordan Acosta
    Member
    Posted 2 years ago #

    You can look at the source code for the theme you're using in the Editor (look in the sidebar under appearance). If the search bar is in the sidebar (as it usually is), then look in the file "sidebar.php". What the code looks like depends on the person who wrote it, but it should be something like this:

    <form action="http://wordpress.org/search/do-search.php" method="get" id="head-search">
    			<input class="text" name="search" type="text" value="Search WordPress.org" maxlength="150" onfocus="this.value=(this.value=='Search WordPress.org') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'Search WordPress.org' : this.value;" /> <input type="submit" class="button" value="Go" />
    		</form>

    If you see something like that, then the search bar is coded in. You can remove it by deleting the code, or you can comment it out (by putting <!-- in front of it, and --> at the end).

    If you're not comfortable with editing code yourself, you can always post a link in this thread to the theme you want to use. I or someone else should be able to tell you if that theme has a search bar coded in, and what to do about it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.