- This topic has 5 replies, 2 voices, and was last updated 3 years, 3 months ago by David.
-
AuthorPosts
-
December 29, 2020 at 4:58 am #1598038johnaps
Hello i want the #generate-slideout-menu element to exist only some pages…
Can i enable it only on specific pages with a hook or something?Because on pages like this https://sofianos-orthopedika.gr/%CE%B1%CE%BD%CE%B1%CF%80%CE%B7%CF%81%CE%B9%CE%BA%CE%AC-%CE%B1%CE%BC%CE%B1%CE%BE%CE%AF%CE%B4%CE%B9%CE%B1/%CE%B1%CE%BC%CE%B1%CE%BE%CE%AF%CE%B4%CE%B9%CE%B1-%CE%B5%CE%BD%CE%B7%CE%BB%CE%AF%CE%BA%CF%89%CE%BD/
it is html bloat basically it isnt being used…December 29, 2020 at 5:33 am #1598084DavidStaffCustomer SupportHi there,
you can use
option_generate_menu_plus_setting
filter to disable theslideout_menu
this article explains:https://docs.generatepress.com/article/option_generate_menu_plus_settings/
January 5, 2021 at 2:37 am #1606159johnapsSo would the following work for my case?
//disable #generate-slideout-menu everywhere add_filter( 'option_generate_menu_plus_settings','lh_all_pages_menu_plus_settings' ); function lh_all_pages_menu_plus_settings( $options ) { $options['slideout_menu'] = 'false'; return $options; } //enable #generate-slideout-menu only on product filter categories add_filter( 'option_generate_menu_plus_settings','lh_custom_pages_menu_plus_settings' ); function lh_custom_pages_menu_plus_settings( $options ) { if( is_product_category( array('category1-slug', 'category2-slug' )) ) { $options['slideout_menu'] = 'mobile'; } return $options; }
January 5, 2021 at 5:47 am #1606358DavidStaffCustomer SupportIf you disable the Off Canvas in the Customizer then you should only require the second PHP snippet ie .//enable #generate-slideout-menu only on product filter categories
January 7, 2021 at 7:40 am #1609689johnapsi turned off, off canvas and added this to my functions.php
//enable #generate-slideout-menu only on product filter categories add_filter( 'option_generate_menu_plus_settings','lh_custom_pages_menu_plus_settings' ); function lh_custom_pages_menu_plus_settings( $options ) { if( is_product_category( array('νοσοκομειακα-κρεβατια', 'ηλεκτροκίνητα-αναπηρικά-αμαξίδια', 'χειροκίνητα-αναπηρικά-αμαξίδια', 'μαξιλάρια-ύπνου', '/οξυγονοθεραπεία/συμπυκνωτές-οξυγόνου-φιάλες/')) ) { $options['slideout_menu'] = 'both'; } return $options; }
the button that opens the off canvas menu, that appears under 1050px doesnt work (https://ibb.co/0qhcnxB)
January 7, 2021 at 3:10 pm #1610156DavidStaffCustomer SupportI believe you don’t require the array for the
is_product_category()
eg.is_product_category('category-slug1','category-slug2')
-
AuthorPosts
- You must be logged in to reply to this topic.