Archived topic
Customizing the search results layout and format
5 replies · Started by Zee on April 17, 2021
I'm customizing my search results page the best I can, but I'm having difficulty with it, as there doesn't seem to be an easy way to change just the search results page in the Customizer. Currently the search results seem to follow the layout set by the 'blog archive' layout.
I would ideally like to apply these changes:
- How can I add 'categories' to the meta? I tried switching this on in Appearances > Layout > Blog Archive, and while that did switch on categories for my blog archive pages, my search results pages did not show categories.
- How can I change the 'by' word before the author's name to something else custom, like '•'? I know this can be done with a snippet, but so far my copy-paste experiments have not yielded anything.
- Also observed a strange bug: the
entry-metaelement does not seem to always show - this tends to be on/off randomly as you go to page 2, 3, 4 and so on. for example, for the search term 'mps', theentry-metashows for page 1 and 5, but not 2, 3, and 4. This seems to differ by search term.
Currently these issues/changes are solved by CSS, but would be ideal to get a better solution if there is one:
- Can I position the
entry-metaelement to appear above/before theentry-titleelement? (currently usingposition:absoluteto deal with this) - Can I switch off featured images just for search results pages, but NOT blog archive pages? Currently just using
display:none
Thanks!
Hi Zee,
We introduced dynamic content and dynamic image features to block element in GPP 2.0, you can create your own content templates by using Generateblocks as block editor.
https://wordpress.org/plugins/generateblocks/
Here's a demo on how to use this new feature to build content template:
https://youtu.be/-ZTQP_KA2xE
In your case, you'll choose search result page as location.
Let me know how it works :)
Awesome, this solved a lot of my issues!
One quick question - in the Dynamic Link section I can choose something called 'Post Meta'. Would this allow me to display parent forums / topics in BBpress post types, and what are the meta field names?
See screenshot: https://imgur.com/8hKuPvq
I'm sorry, I'm not familiar with the BBpress plugin, can't help with this.
Maybe reach out to BBpress support?
This is not a bbPress-specific question - I'm asking what does the dynamic text type 'Post Meta' mean when adding a block element in GeneratePress, and since there isn't a dropdown to choose the value, whether there is a list somewhere of available post meta that can be displayed. Thanks!
Hi there,
the Post Meta text type is any Custom Field that is added to a post / post type.
You would need to ask BBPress what Post Meta is registered. And what the Post Meta Keys ( name ) are - as that will be the value you add to the Post Meta text type field.