Search box in wordpress is a widget. A widget is a PHP object that outputs some HTML. The same kind of widget can be used multiple times on the same page (e.g. the Text Widget). Widgets can save data in the database (in the options table).
When you create a new kind of widget, it will appear in the user’s Administration Screens at Appearance > Widgets.
A set of widgets is included with the default WordPress installation. In addition to these standard widgets, extra widgets can be included by themes or plugins. An advantage of widgets built into themes or plugins is to provide extra features and increase the number of widgets.
- Make sure the current template is
widget aware
. ie having sidebars. if the current template is not widget aware , you may- follow the steps in https://developer.wordpress.org/themes/functionality/widgets/ or
- replace existing template witha widget aware template
- Follow the steps bolow in a widget aware template
- Go to your Admin Dashboard.
- Navigate to Appearance > Widgets. Here, you'll find the widget named Search under the Available Widgets.
- Click on it and then hit the Add Widget button. You can also drag it to the Widget Area. You can add the title for your search widget if required.
- Now go to your site and you'll see the Search widget on the sidebar.
|
|