Although Uncode is flexible, with a commercial theme we try first to replicate the most common web design and usability patterns. Multiple menu styles within the same site are not common and could disorient most visitors. In any case, if you need to apply different menu styles to different pages for special needs, you can use this hook (in the Child Theme) and insert the IDs of the pages you need to be modified into the "$ ids" array.
/********************** * * Filter menu type according with post ID (or any other condition) * @param string $val The default menu type * @return $val * **********************/ function uncode_child_filter_display_menu( $val ) { global $post; // Page IDs $ids = array( 2, 3541, 18907 ); if ( $post && in_array( $post->ID, $ids ) ) { $val = 'menu-overlay'; } return $val; } add_filter( 'uncode_ot_get_option_uncode_headers', 'uncode_child_filter_display_menu' );
Following the technical name value of the menu layouts :
- Right -> 'hmenu-right'
- Justify -> 'hmenu-justify'
- Left -> 'hmenu-left'
- Center -> 'hmenu-center'
- Center Split -> 'hmenu-center-split'
- Center Double -> 'hmenu-center-double'
- Lateral -> 'vmenu'
- Off Canvas -> 'vmenu-offcanvas'
- Overlay -> 'menu-overlay'
- Overlay Center -> 'menu-overlay-center'
If you are using a version prior to Uncode 2.6.0 the code to use is this:
/********************** * * Filter menu type according with post ID (or any other condition) * @param string $val The default menu type * @return $val * **********************/ add_filter('option_uncode', 'uncode_child_filter_display_menu'); function uncode_child_filter_display_menu( $val ){ global $post; $ids = array(2, 3541, 18907); if ( $post && in_array( $post->ID, $ids ) ) { $val['_uncode_headers'] = 'menu-overlay'; } return $val; }
Comments
0 comments
Article is closed for comments.