332 posts
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
CadenGrant says

I’m trying to insert a custom searchbar into the header but it’s not working. Everytime I hit enter it just like refreshes the page or something. Here’s the code im using:

<form method="get" action="<?php bloginfo('home'); ?>" role="search">
                <input class="searchinput" value="Search the site..." type="text" onfocus="if (this.value == 'Search the site...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search the site...';}" />
                <input class="searchsubmit" value="Search" type="submit" />
            </form>

Anybody know why its not working?

332 posts
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
CadenGrant says

Now somehow the search widget doesn’t even work =/ Just redirects to the homepage.. This ever happened to anybody?

1383 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
wpCanyonThemes says

Now somehow the search widget doesn’t even work =/ Just redirects to the homepage.. This ever happened to anybody?

Where is the name of the input? :)

Should be “s”.

2468 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $100+ on Envato Market
  • Has referred 100+ members
  • Has been a beta tester for an Envato feature
+3 more
digitalimpact says

The input text field should be named “s”

So:


<form method="get" role="search" action="<?php bloginfo('home'); ?>">
                <input name="s" class="searchinput" type="text" value="Search the site..." onfocus="if (this.value == 'Search the site...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search the site...';}" />
                <input class="searchsubmit" type="submit" value="Search" />
            </form>


EDIT : Boba’s too fast :P

332 posts
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
CadenGrant says

Oh haha my bad – thanks :)

1383 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
wpCanyonThemes says

@digitalimpact – Haha :)

@CadenGrant – Welcome, it’s usually simple probs like that that take the most time to figure out :) Additional set of eyes helps a lot.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by