- This topic has 15 replies, 3 voices, and was last updated 4 years, 11 months ago by Tom.
-
AuthorPosts
-
May 1, 2019 at 11:02 pm #886161Michael
Hi i tried to make a custom result page . i tried to add the function in
https://docs.generatepress.com/article/option_generate_blog_settings/
but it doesnt work, i trited to put it in function.php or using plugin code snipet.
neither does the job.
i am using generate press theme and plugin.May 2, 2019 at 7:18 am #886696LeoStaffCustomer SupportHi there,
What are you trying to achieve?
Can you provide the code you used?
Make sure to highlight them and click the code button when posting here.
Let me know π
May 2, 2019 at 10:11 am #886894Michaelim trying to make customize my search result page like post, remove widget and header etc
i am using the code from documentation exampleadd_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['date'] = false; $options['categories'] = false; $options['tags'] = false; $options['comments'] = false; $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['column_layout'] = false; $options['featured_column'] = true; $options['masonry'] = false; } return $options; }
im trying to put in code snipet and function.php but it didnt work
May 2, 2019 at 12:42 pm #887047TomLead DeveloperLead DeveloperHi there,
I’m not sure that function is what you’re after.
Are you wanting your search results not to have a sidebar?
If so, you can:
1. Create a Layout Element: https://docs.generatepress.com/article/layout-element-overview/
2. Set the sidebar layout
3. Set the Display Rules to “Search Results”Let me know π
May 2, 2019 at 7:42 pm #887294MichaelThat is what i need, thank you tom.
i have get rid of sidebar and all elements that i dont need. but the search result layout is not very nice
is there a way to display search result like plugin wp_show_poststhank you
May 3, 2019 at 8:33 am #888061TomLead DeveloperLead DeveloperIt depends on how you’re using WP Show Posts. You can set up columns etc.. using the Blog module in Customize > Layout > Blog.
Let me know π
May 6, 2019 at 6:56 pm #891244Michaelim trying to modify search result,
in Blog module in Customize > Layout > Blog.
theres only option for archive and single, no option for search result page?May 6, 2019 at 7:17 pm #891252LeoStaffCustomer SupportNot in the customizer, but you can use a filter:
https://docs.generatepress.com/article/using-columns-in-the-blog/#changing-the-number-of-columnsAdding PHP: https://docs.generatepress.com/article/adding-php/
May 8, 2019 at 1:45 am #892567Michaeli have tried to use the code and put it in code snippet or function.php but it doesnt work
this code:
add_filter( ‘generate_blog_get_column_count’,’tu_search_column_count’ );
function tu_search_column_count( $count ) {
if ( is_search() ) {
return 33;
}return $count;
}May 8, 2019 at 7:54 am #892975LeoStaffCustomer SupportThat code should work.
Have you tried clearing the caching plugin and disable it as we suggested in the start a new topic checklist?
What can I search to see the search result page? The site isn’t in English.
Let me know π
May 8, 2019 at 9:09 am #893093Michaeli have cleared the caching and disable it in plugin section
this is the link to the search result page
https://agenkutus.com/?s=siMay 8, 2019 at 11:58 am #893295LeoStaffCustomer SupportHmm the code should definitely work.
Are you currently adding it using Code Snippets?
Can you make sure the snippet is actually activated?
May 8, 2019 at 2:52 pm #893432Michaelim using code snipet and its activated.
May 8, 2019 at 4:32 pm #893506TomLead DeveloperLead DeveloperIs the columns option turned on in the Customizer?
If not, you may need to add this as well:
add_filter( 'generate_blog_columns', function( $columns ) { if ( is_search() ) { return true; } return $columns; } );
May 9, 2019 at 5:28 am #893953Michaelit works now tom, thank you
-
AuthorPosts
- You must be logged in to reply to this topic.