Archived topic
Trying to add search box widget to sidebar
7 replies · Started by Rob on February 8, 2022
Hi, I'm trying to add a search box widget to the sidebar of my site:
sidebar
But the widget is not showing up in the list of available widgets.
Is this the right way to add a 3rd party widget in GP?
Thanks for your help.
Hi Rob,
From Appearance > Widgets you should be able to add Search blocks as such: https://share.getcloudapp.com/7KuqZxzz
Alternatively, you can also add Search blocks/widgets through Block Elements.
See this for reference: https://share.getcloudapp.com/Wnuq8A6q
You just need to set the element type to “Right Sidebar” to make it appear in the sidebar. Take note that doing so through the Block Elements will remove the current sidebar widgets for the selected sidebar. Moreover, your layout must have a sidebar set for the Element to show.
Furthermore, if the Search widget/block is indeed missing, could you test for plugin conflict. Kindly check if any plugin is causing the widget to disappear. To do this, you would need to disable your plugins one by one.
Hope this helps! :)
Thanks, Fernando. I tried the first method you mentioned but the plugin (Relevanssi search box) does not show up in the list of widgets. So I tried the 2nd approach you mentioned and tried to add a 'sidebar' block. But I can't see how to do that. Here is a video showing my attempt at adding a sidebar block:
Thanks for your help.
Hi there,
the Block Element method, isn't going to work as it looks like you have the Classic Editor plugin enabled, which is removing the Block Editor.
The sidebar itself should work - can you share a URL to the page where its should be displayed ?
Hi, thanks for getting back to me.
As far as URL, I'm wanting to place a search box (Relevanssi) in the righthand sidebar of all my blog posts. But here is a URL, as an example: https://robpowellbizblog.com/google-freshness-algorithm/
Thanks.
Try disabling the Block Editor Widgets:
https://docs.generatepress.com/article/disable-the-block-editor-in-widgets/
Perhaps Relevansi only has a classic widget, so it should show after making that change.
Thanks, David. I added the code to the PHP file and it's all good now.
Thanks!
Glad to hear that!