• Resolved webguync

    (@webguync)


    I made some changes to a template and added a page called searchform.php with the following code.

    <form action=”/” method=”get”>
    <fieldset>
    <label for=”search”>Search in <?php echo home_url( ‘/’ ); ?></label>
    <input type=”text” name=”s” id=”search” value=”<?php the_search_query(); ?>” />
    <input type=”image” alt=”Search” src=”<?php bloginfo( ‘template_url’ ); ?>/images/buttons/Search.png” />
    </fieldset>
    </form>

    the form isn’t working. It just takes you to the home page. For example my blog is at https://www.mysite.com/blog and the form send you to https://www.mysite.com.

    any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I use this code in my base theme and it works all the time.

    <form action="<?php bloginfo('url'); ?>" id="searchform" method="get">
        <div>
            <label for="s" class="screen-reader-text">Search for:</label>
            <input type="text" id="s" name="s" value="" />
            <input type="submit" value="Search" id="searchsubmit" />
        </div>
    </form>
    Thread Starter webguync

    (@webguync)

    thanks, that did the trick!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘search form not working’ is closed to new replies.