Viewing 2 replies - 1 through 2 (of 2 total)
  • You can use a widget to show the search anywhere in your theme. Here’s how to do it:

    1) Place this code in your functions.php file:

    // adds a widget area
    if (function_exists('register_sidebar')) {
    
    	register_sidebar(array(
    		'name' => 'Search Field',
    		'id'   => 'search-field',
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
    		'after_widget'  => '</div>'
    
    	));
    
    }

    2) Next you’ll see the above widget appear in your widgets area in WP-Admin. Move the Geo Mashup search there.

    3) Add the search to any theme page with this code:

    <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('search-field')) : ?><?php endif; ?>

    Hope that helps!

    Pete

    (@perthmetro)

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘place a search form on a page’ is closed to new replies.