Customizing search widget with searchform.php does not work
-
I display sidebar with the command dynamic_sidebar(‘main_sidebar’) in single.php and define a new search form in searchform.php but the new search form does not display. What is the procedure to display the new search form in searchform.php?
single.php:
<aside id="sidebar"> ? ? ? ? <?php dynamic_sidebar('main_sidebar'); ?> ? ? ? </aside>
searchform.php:
<form method="GET" action="<?php echo home_url(); ?>"> <input type="search" name="s" placeholder="Search Here..." value="<?php echo get_search_query(); ?>"> <input type="submit" id="search-btn" value=""> </form>
functions.php
function fcc_widgets(){ register_sidebar([ 'name' => 'Main Sidebar', 'id' => 'main_sidebar', 'before_title' => '<h3>', 'after_title' => '</h3>', ]); } add_action('widgets_init', 'fcc_widgets');
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Customizing search widget with searchform.php does not work’ is closed to new replies.