- This topic has 10 replies, 5 voices, and was last updated 1 year, 10 months ago by David.
-
AuthorPosts
-
December 1, 2020 at 9:18 am #1561190Fandi Ahmad
Hi, My Name is Fandi from Indonesia, I was installed GeneratePress and I think that as a awesome Theme I ever installed.
I just want to ask a litte bit basic question about “how to customize the result page”. I want to customize the result page of my website “—-” same with the homepage or something like “just the image and tittle show on there”
Sample of my result page: —-
Want same like my home page or similar of that.Thank you.
December 1, 2020 at 11:12 am #1561707LeoStaffCustomer SupportHi there,
Sorry but I don’t understand the requirement.
The search result page is supposed to show all the search results when a keyword is searched.
Are you only wanting to show a static page?
December 1, 2020 at 1:32 pm #1562132Fandi AhmadNo, I just want to make my result page appearance same like the homepage when a keyword is searched. thanks.
December 1, 2020 at 4:16 pm #1562403ElvinStaffCustomer SupportHi,
To clarify: You’re trying to display the search results in columns/cards like the products in home page?
If so, you can set the search display result through Dashboard > Appearance > Customize > Layout > Blog and set check “Display posts in columns”. But this will also apply to blog archives as well.
Alternatively, if you only want this to apply on the search page only, you can use this PHP snippet:
add_filter( 'generate_blog_columns','tu_portfolio_columns' ); function tu_portfolio_columns( $columns ) { if ( is_search() ) { return true; } return $columns; } add_filter( 'generate_blog_get_column_count','tu_search_column_count' ); function tu_search_column_count( $count ) { if ( is_search() ) { return 25; } return $count; }
December 1, 2020 at 11:26 pm #1562886Fandi AhmadHi, thank you its work.
But, Can I show the tittle & product image only on there? Similar like my homepage.
December 1, 2020 at 11:32 pm #1562895ElvinStaffCustomer SupportBut, Can I show the tittle & product image only on there? Similar like my homepage.
We can hide the excerpt from display by adding this CSS:
body.search .entry-summary, body.search .entry-content { display: none; }
December 2, 2020 at 1:12 am #1563043Fandi AhmadThanks for the answer its work, but the downlaod link still appear on there, can I hide that also? thanks.
December 2, 2020 at 2:12 am #1563164Fandi AhmadI was hide it on exclude “in element” but the download link still appear on that, I only want to my products appear on there. no other. thanks
December 2, 2020 at 6:42 am #1563682DavidStaffCustomer SupportHi there,
did you resolve the issue?
May 17, 2022 at 12:42 pm #2222967PatrickHi,
===
Nevermind, already solved, I’ve had to look better:
https://docs.generatepress.com/article/option_generate_blog_settings/
==Initial question:
In reply to Elvin’s script suggestion:add_filter( 'generate_blog_columns','tu_portfolio_columns' ); function tu_portfolio_columns( $columns ) { if ( is_search() ) { return true; } return $columns; } add_filter( 'generate_blog_get_column_count','tu_search_column_count' ); function tu_search_column_count( $count ) { if ( is_search() ) { return 25; } return $count; }
I know it’s an old topic but my question is very related.
My search results are in 3 columns because this is indeed the blog setting. However I want the search result to be a single 100% width column.
So actually I need this script the other way around. Can you help me out?
Thanks,
– PatrickMay 18, 2022 at 3:00 am #2223410DavidStaffCustomer SupportHi there,
you can do:
add_filter( 'generate_blog_get_column_count','tu_search_column_count' ); function tu_search_column_count( $count ) { if ( is_search() ) { return 100; } return $count; }
This will force the search to be a single column.
-
AuthorPosts
- You must be logged in to reply to this topic.