- This topic has 9 replies, 3 voices, and was last updated 4 years, 5 months ago by David.
-
AuthorPosts
-
October 27, 2019 at 6:29 am #1045738Santa
Hello! Is it possible to change how posts are displayed in search results page? Currently there are 2 columns and no title or tags to the post, as well it displays also not only posts, but pages/links that include the word. Is it possible to change the layout to 4 columns and when there is for example only 1 result as a page/link, show posts in one line, not like masonry? Could the padding between page/link results be removed as well?
– When nothing found the footer overlays the “no results”. What can be done here?
Thank you!
October 27, 2019 at 5:48 pm #1046284LeoStaffCustomer SupportHi there,
Currently, the search results page inherits the settings under Layout > Blog in the customizer.
If you want the layout to be different than the main posts page, this filter is needed:
https://docs.generatepress.com/article/option_generate_blog_settings/You can see an example at the bottom:
https://docs.generatepress.com/article/option_generate_blog_settings/#examplesLet me know if this helps π
October 28, 2019 at 12:07 pm #1047142SantaHi Leo! Thank you for your help! Can you please tell what should be changed here:
add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' ); function lh_custom_search_results_page_settings( $options ) { if ( is_search() ) { $options['read_more_button'] = true; $options['infinite_scroll'] = true; $options['infinite_scroll_button'] = true; $options['masonry_load_more'] = 'More search results'; $options['post_image'] = true; $options['post_image_position'] = 'post-image-above-header'; $options['post_image_alignment'] = 'post-image-aligned-center'; $options['featured_column'] = true; $options['masonry'] = false; } return $options; }
to make it 3 collumns for this page? Or it can be changed only in Customizer?
Is it possible to reduce spacing between result titles?October 28, 2019 at 1:02 pm #1047185LeoStaffCustomer SupportYou only need to add the options you are wanting to change. For example, if you want to turn off infinite scroll for the search result page, then this is all you need:
add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' ); function lh_custom_search_results_page_settings( $options ) { if ( is_search() ) { $options['infinite_scroll'] = false; } return $options; }
Columns would require this filter:
https://docs.generatepress.com/article/using-columns-in-the-blog/#changing-the-number-of-columnsSpace between titles would require some CSS. Let me know when the above is done π
October 29, 2019 at 8:36 am #1047919SantaHi Leo! Thank you so much! Works great! Sounds good, how to achieve smaller space between titles? π
October 29, 2019 at 11:02 am #1048046LeoStaffCustomer SupportAre you done with all other tweaking now? So you want the featured image to show?
October 30, 2019 at 3:23 am #1048546SantaHi Leo! Everything is great, except for the titles that appearing on top of search results. I would like to reduce space between them. How to achieve this? Thank you!
October 30, 2019 at 10:48 am #1049050LeoStaffCustomer SupportSo this is what I’m seeing right now:
https://www.screencast.com/t/2kdlcjRkGJust to confirm, you still want some of the featured images to show?
It’s not really possible to target the title without featured images only.
October 31, 2019 at 12:05 am #1049366SantaHi Leo! For the spacing I meant the spacing for search results on top of the featured images. Not the titles for the posts in the photo, but for the titles/results on top of the post results with featured photos. Is it possible to reduce spacing for these results? Thanks!
October 31, 2019 at 7:44 am #1049613DavidStaffCustomer SupportHi there,
give this CSS a shot:
.search .entry-summary { margin: 0; } .search.separate-containers .inside-article { padding-top: 0px; }
-
AuthorPosts
- You must be logged in to reply to this topic.