Tagged: full width, submenu
-
AuthorPosts
-
August 9, 2017 at 9:44 pm #836635
Hiya
I’m attempting to add the full width submenu to the posts template just below the theme navigation. I’ve managed to add and the output looks good using
<div class="clear"></div> <div id="sub_menu1" class="av-submenu-container main_color blog_menu av-sticky-submenu container_wrap fullsize" style="z-index:301"><div class="container av-menu-mobile-active "> <?php wp_nav_menu( array( 'menu' => 'Categories', 'menu_id' => 'categories', 'menu_class' => 'av-subnav-menu av-submenu-pos-center', 'container' => false, 'fallback_cb' => false ) ); ?> </div></div>
However for some reason I can’t get the span classes for avia-bullet, avia-menu-text or avia-menu-fx to show on the menu i’ve added via single.php?
Is there a quick way to fix?
Thanks
Richard- This topic was modified 7 years, 3 months ago by raslade.
August 10, 2017 at 5:58 am #836744Hey raslade,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Best regards,
John TorvikAugust 10, 2017 at 9:26 am #836840This reply has been marked as private.August 15, 2017 at 9:21 am #839123Hi,
Instead of wrapping the wp_nav_menu inside the sub menu shortcode, please try to use the actual sub menu shortcode in combination with the do_shortcode function. Something like this:
echo do_shortcode("[av_submenu which_menu='center' menu='' position='center' color='main_color' sticky='true' mobile='disabled' mobile_submenu=''] [av_submenu_item title='Menu Item 1'] [av_submenu_item title='Menu Item 2'] [/av_submenu]");
Best regards,
IsmaelAugust 15, 2017 at 10:43 am #839168Hi Ismael
Thanks for this but do you mean add this example to the single.php file or in to the functions file?Richard
August 15, 2017 at 5:51 pm #839465Ismael
I’ve added the following to functions:
add_action('ava_after_main_title', 'ava_after_main_title_mod'); function ava_after_main_title_mod() { if( is_singular('post') ) { echo do_shortcode("[av_submenu which_menu='' menu='4' position='center' color='main_color' sticky='aviaTBsticky' mobile='disabled'] [av_submenu_item title='Treatments' link='manually,http://' linktarget='' button_style=''] [av_submenu_item title='Spa Days' link='manually,http://' linktarget='' button_style=''] [av_submenu_item title='Fitness' link='manually,http://' linktarget='' button_style=''] [av_submenu_item title='Fashion' link='manually,http://' linktarget='' button_style=''] [av_submenu_item title='Health' link='manually,http://' linktarget='' button_style=''] [av_submenu_item title='Special offers' link='manually,http://' linktarget='' button_style=''] [/av_submenu]"); } }
Which has worked for posts only. However it’s pushing the widget column down the page. See link.
Any idea how to fix?
Thanks
RichardAugust 16, 2017 at 7:25 am #839730Hi,
The element creates another closing div which breaks the layout of the page. Please replace it with the following codes.
add_action('wp_footer', 'ava_after_main_title_mod'); function ava_after_main_title_mod() { if( is_singular('post') ) { echo " <div id='custom-fullwidth'>"; echo do_shortcode("[av_submenu which_menu='' menu='4' position='center' color='main_color' sticky='aviaTBsticky' mobile='disabled'] [av_submenu_item title='Treatments' link='manually,http://' linktarget='' button_style=''] [av_submenu_item title='Spa Days' link='manually,http://' linktarget='' button_style=''] [av_submenu_item title='Fitness' link='manually,http://' linktarget='' button_style=''] [av_submenu_item title='Fashion' link='manually,http://' linktarget='' button_style=''] [av_submenu_item title='Health' link='manually,http://' linktarget='' button_style=''] [av_submenu_item title='Special offers' link='manually,http://' linktarget='' button_style=''] [/av_submenu]"); echo "</div> "; } } function ava_custom_script_mod_submenu(){ ?> <script> (function($){ $('#custom-fullwidth').next('.clear').appendTo('#custom-fullwidth'); $('#custom-fullwidth').next('.av-submenu-container').appendTo('#custom-fullwidth'); $('#custom-fullwidth').next('.sticky_placeholder').appendTo('#custom-fullwidth'); $('#custom-fullwidth').prependTo('#main'); $('#custom-fullwidth').prependTo('#main'); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_custom_script_mod_submenu');
Best regards,
IsmaelAugust 16, 2017 at 8:49 am #839769Hi Ismael
Perfect thank you very much for the extra code. Works like a dream.
Richard
August 16, 2017 at 2:32 pm #839886Hi Richard,
Glad Ismael could help!
Please take a moment to review our theme and show your support https://themeforest.net/downloads
To know more about enfold features please check – http://kriesi.at/documentation/enfold/
Thank you for using Enfold :)Best regards,
VictoriaAugust 17, 2017 at 7:53 pm #840595Thanks Victoria, will do.
August 17, 2017 at 11:18 pm #840654Hi,
Will close the ticket here, please feel free to create a new one if you need anything else.
Best regards,
Basilis -
AuthorPosts
- The topic ‘Adding full width submenu to post template’ is closed to new replies.