-
jrmora
Hello,
I want to customise and improve the search results page a bit and I’ve found that I don’t know where to start.I’ve created other custom pages and added content with GenerateBlocks loops using Elements, but I can’t figure out how to get to the dynamic content that displays the search results. Maybe I’m a bit clumsy ๐
Is there a specific tutorial for this in particular?
I’ve searched the GP forum, but still can’t find anything basic on this.
I would just need a hint on how to start adding search results content to a block with Elements and then apply a template to it.
Thank you very much for your help. -
Hi there,
what kind of changes do you want to make to the Search Results ? As this will determine what needs to be done ๐
-
jrmora
Hi, David
Mainly aesthetic changes and modifying the number of words in the excerpt and the number of results per page, but also adding a hit counter next to the title or below (based on the WordPress Popular Posts plugin) and possibly the reading time.Also remove the sidebar and create a specific one just for the results (but I already know how to do that with a GB layout).
I would also like to make changes to improve the response of the results, but I know that this is more complicated without resorting to third party solutions.
-
Fernando
Hi Jrmora,
You can try using a Block Element – Loop Template to create a Layout for your Search page. Reference: https://docs.generatepress.com/article/block-element-loop-template/
Through a Query Loop and GB Block Elements, you can retrieve data like the excerpt dynamically. Reference: https://docs.generateblocks.com/article/dynamic-data-options-overview/#excerpt
As for the Reading time, you’ll need a custom code for this or a third-party plugin. It would be best to create a new topic specifically for this once you’re layout has been created. Just add a Headline Block for it for now as a placeholder.
-
jrmora
Thanks, Fernando
There was my “problem”, I was not selecting “Inherit query from template” toggle in Query Loop :S
Now I can see the way.For the reading time is not problem. I’ve had it solved out for a while with a function snippet and now and I’m using it without any problems under the post titles, now I just need to add it to the loop.
If I get stuck in the process with something I’ll be back to bother again ๐
Thanks a lot again -
Fernando
Glad you got it! You’re welcome, Jrmora! ๐
- You must be logged in to reply to this topic.