- This topic has 11 replies, 4 voices, and was last updated 2 years, 6 months ago by David.
-
AuthorPosts
-
July 1, 2021 at 9:01 am #1841298BreoganGal
Hi, I have done the two steps to put the search in three columns but it still keeps showing in one column. I have no cache, I don’t know what it can be. I have added the two pieces of code you commented on in the functions.php:
add_filter( ‘generate_blog_get_column_count’,’tu_search_column_count’ ); function tu_search_column_count( $count ) { if ( is_search() ) { return 33; } return $count; }
add_filter( 'option_generate_blog_settings', 'lh_search_columns' ); function lh_search_columns( $options ) { if ( is_search() ) { $options['column_layout'] = true; } return $options; }
If you need I give you credentials to review it.
July 1, 2021 at 10:27 am #1841384LeoStaffCustomer SupportHi there,
Looks like the quotation marks are wrong on the first block of code.
Try this instead:
add_filter( 'generate_blog_get_column_count','tu_search_column_count' ); function tu_search_column_count( $count ) { if ( is_search() ) { return 33; } return $count; }
July 2, 2021 at 2:21 am #1841887BreoganGaladd_filter( 'generate_blog_get_column_count','tu_search_column_count' ); function tu_search_column_count( $count ) { if ( is_search() ) { return 33; } return $count; } add_filter( 'option_generate_blog_settings', 'lh_search_columns' ); function lh_search_columns( $options ) { if ( is_search() ) { $options['column_layout'] = true; } return $options; }
This is the code of functions.php. still not working
July 2, 2021 at 3:49 am #1841953DavidStaffCustomer SupportJuly 6, 2021 at 6:57 am #1846370BreoganGalWith a category filter does not work
July 6, 2021 at 7:39 am #1846412DavidStaffCustomer SupportWhen that filter is applied it takes you to the ‘blog’ template which is set to 1 column.
Unless you want to change the main blog to 3 columns you would need to check with the Plugin author to see if it can use AJAX to filter the template or allow you to choose the search results template.July 7, 2021 at 5:08 am #1847485BreoganGalOk, they have already solved it for me. But now I have the problem that the buy button does not appear in the search results. How can I insert it?
July 7, 2021 at 9:22 am #1847943LeoStaffCustomer SupportCan you open a new topic for the new question?
I’ll mark this one as resolved.
Thanks 🙂
October 23, 2021 at 4:01 am #1972530Junior GongHey guys
I used the code suggested here to make sure that my search layout does not display columns. Unfortunately on tablet view the search results are still displayed in 2 columns, see here:
https://www.cannabisanbauen.net/?s=faustregel
Scr: https://www.dropbox.com/s/ggktr41vwn7p45j/Screenshot%202021-10-23%20at%2013.00.15.png?dl=0
I am using the folling snippet below. How do I have to modify it so that the one column layout is also applied to tablet view?
add_filter( 'generate_blog_get_column_count','tu_search_column_count' ); function tu_search_column_count( $count ) { if ( is_search() ) { return 100; } return $count; }
October 23, 2021 at 6:52 am #1972617DavidStaffCustomer SupportHi there,
remove that snippet and try this instead:
add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' ); function lh_custom_search_results_page_settings( $options ) { if ( is_search() ) { $options['column_layout'] = false; } return $options; }
If you’re still having issues, please raise a new topic where you can share a link to your site ( in the Private Information field ) and we can take a look.
October 23, 2021 at 10:32 am #1972982Junior GongAwesome, that works now! thx for the quick support!
October 23, 2021 at 4:30 pm #1973173DavidStaffCustomer SupportGlad to be of help!
-
AuthorPosts
- You must be logged in to reply to this topic.