0
Mohammed Alkhabaz
I wish to use the search function in a sidebar for multiple pages in my theme. I'd like the search sidebar to create a dropdown of search results and if you click search instead of an input, i want it to load a post grid with the input the user entered already in the searchbar of the post grid.
In short. Sidebar on multiple pages has search function. User types "Hello" in search. Search page loads with post grid with a search input of "Hello" showing the results as it normally does in a post grid.
How can intergrade the search function in post grid with other things? PHP isn't my strong point but if you could guide me in the right direction, i can figure things out.
2 Subscribers
Submit Answer
1 Answers
Best Answer
0
Welcome to our forum.
by default post grid search features isn't advanced enough, however, it's quite possible to extend, we have released a free add-on for extend search feature to show an example how does it work,
please check this addon
https://github.com/pickplugins/post-grid-search
under the "post-grid-search/blob/master/templates/post-grid-hook.php" file you will see the sample code,
https://github.com/pickplugins/post-grid-search/blob/master/templates/post-grid-hook.php
if you want to display search form on sidebar please create a shortcode or widget first, see the sample code used for "post_grid_query_args" hooked functions "post_grid_query_custom_search" on that file,
also, see the documentation on how does filter hook "post_grid_query_args" works
https://pickplugins.com/documentation/post-grid/filter-hooks/post_grid_query_args/
