0

This is how I have defined the sidebars in functions.php file →

function zebra_sidebar() {
register_sidebar (array(
    'name' => 'Vertical Sidebar',
    'id' => 'sidebar1',
    'before_widget' => '<div class="widget-item">',
    'after_widget' => '</div>'
));
register_sidebar (array(
    'name' => 'Horizontal Sidebar',
    'id' => 'sidebar2',
    'before_widget' => '<div class="widget-item">',
    'after_widget' => '</div>'
));
register_sidebar (array(
    'name' => 'Footer Sidebar',
    'id' => 'sidebar3',
    'before_widget' => '<div class="widget-item">',
    'after_widget' => '</div>'
));
}
add_action('widgets_init', 'zebra_sidebar');

is there any flaw in my sidebar definition? Because even those widgets that are in the core WordPress such as search widget is only displaying Title on the front page, but not the search Input box. Although the search widget is a default WordPress widget provide at the time of fresh WordPress installation.

The Live WP site is provided here.

Reference 1 Reference 2

  • 1
    This could happen if e.g. your theme's searchform.php file is empty or problematic get_search_form filter used in your theme or plugins. – birgire May 1 '17 at 9:21
  • 1
    Oh Yes you are right. the searchform.php is empty. I used this → screencast.com/t/xTp5azQrBw Can you please write an answer so that I can accept. – The WP Intermediate May 1 '17 at 9:30
0

There is not any flaw in the way you've defined the sidebar. This is not supposed to happen because WordPress provides search form field to the front by default. There must be some issue with the theme you are using or the WordPress version you are using right now. What is the WordPress Version you've right now?

Or there must be some hook in your theme that is affecting to display it from the widget.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.