Archived topic
Customize Search Page
9 replies · Started by Samuel on December 8, 2019
Hi,
I looked around the forum but didn't found what i needed, except maybe the idea that it couldn't be possible but I'm asking to be sure.
I'm using a grid plugin to display all my archives pages, to do so i used your PHP function to use page instead of category and tag archives. The design is simple, items are displaying with a square image and title inside the image with overlay effect.
The only page i can't customize like this is the search result page... is there a way to hook it like my category and tag archives ? Or any possibility to use my grid plugin inside Search page ? Or any other idea ?
Thanks a lot,
Samuel
Hi there,
Any chance you can link us to the site in question?
You can edit the original topic and use the private URL field.
Let me know :)
As I'm working local it's not as simple as that but I can run a test website if you need it ? The plugin I'm using is WP Grid Builder by Themeone : https://wpgridbuilder.com
Hmm I believe you'd need to ask the plugin support to see if it can be used in the search result page.
Ok, so I resolved this with
<?php echo do_shortcode( '[wpgb_grid id="1" is_main_query="true"]' );
To replace the main loop in search.php :
<?php while ( have_posts() ) : the_post();
get_template_part( 'content', 'search' );
endwhile;
By the way I have other problem regarding header of the search page. Using element I'm not able to do anything, nothing is changing in the header... display rules is on "search result"... do I miss something ?
Even this https://generatepress.com/forums/topic/page-header-on-search-page/#post-1056795 is not working.
Thanks for your help !
Hi there,
So when you create a new Element and set the Display Rules to your search results, nothing shows up at all?
Let me know :)
Hi,
This is exactly it
Can you show me a screenshot of your hook content and your Display Rules, and then link me to the search results page?
Thanks!
I'm working on local server so I can't send you the search result page, and I don't know how to upload image here... but my Display Rule is "Location : Search Result", and my hook content is adding <h1>[search-title]</h1> shortcode to display title in header (for now it's displaying under header), also I tried to put a "section image : custom image", etc. etc.
If you need access, I think I'll publish my website soon and I'll hide header with css. When online I'll send you a link.
A link would definitely be helpful. Which hook is the Element added to?