-
AuthorPosts
-
November 1, 2015 at 12:39 am #528025
Hi,
I have been follwoing this thread https://kriesi.at/support/topic/full-width-submenu-as-new-menu-location/
What I want is the same (but on the archive pages and single news items, so the user also always sees the submenu)
I managed this by adding the shortcode of the fullwidth menu to the archive page, but also experience the sidebar issue. It messes up my site’s layout and header.
What I do is the following
<?php echo do_shortcode("[av_submenu which_menu='' menu='49' position='center' color='main_color' sticky='aviaTBsticky' mobile='active'] [av_submenu_item title='Menu Item 1' link='' linktarget='no' button_style=''] [av_submenu_item title='Menu Item 2' link='' linktarget='no' button_style=''] [/av_submenu]"); ?>
Is there another method to insert the menu into an archive or any other page that hasn’t the layout editor?
I tried it doing the native menu element of wordpress wp_nav_menu, which works also, but then the mobile toggle doesn’t work.So both methods return only half the solution.
Thank you
Thank you.
- This topic was modified 9 years ago by Spiv.
November 2, 2015 at 5:07 pm #528638Hey Spiv!
Can you please post the link to your page where we can see the issue with sidebar?
Fullwidth elements pushes the sidebar below them so it should be expected behaviour but we would like look into itRegards,
YigitNovember 7, 2015 at 7:37 pm #531922Hi Yigit,
see the link as example where I inserted the shortcode into the archive.php.
As you see, it is messing up my header style and sidebar. The rest is fully functional.
I can’t figure out to get this right.Thanks
November 10, 2015 at 3:51 pm #533363Hey!
Can you paste the full code you’re using to include the menu?
Cheers!
JosueNovember 13, 2015 at 10:30 am #535306Hi, see below the full archive.php code
<?php global $avia_config, $more; /* * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory. */ get_header(); $showheader = true; if(avia_get_option('frontpage') && $blogpage_id = avia_get_option('blogpage')) { if(get_post_meta($blogpage_id, 'header', true) == 'no') $showheader = false; } if($showheader) { echo avia_title(array('title' => avia_which_archive())); } do_action( 'ava_after_main_title' ); $cats .= get_the_term_list($the_id, $taxonomy, '', ', ','').' '; ?> <?php echo do_shortcode("[av_submenu which_menu='' menu='49' position='center' color='main_color' sticky='aviaTBsticky' mobile='active'] [av_submenu_item title='Menu Item 1' link='' linktarget='no' button_style=''] [av_submenu_item title='Menu Item 2' link='' linktarget='no' button_style=''] [/av_submenu]"); ?> <div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'> <div id="av_section_1" class="avia-section main_color avia-section-default avia-no-shadow avia-full-stretch avia-bg-style-scroll avia-builder-el-0 el_before_av_one_full avia-builder-el-first container_wrap sidebar_left" style="background-repeat: no-repeat; background-image: url(/wp-content/uploads/sites/10/2015/10/ESWI_beeldenweb6-1500x430.jpg); background-attachment: scroll; background-position: center center; " data-section-bg-repeat="stretch"> <div class="container"> <main role="main" itemprop="mainContentOfPage" class="template-page content av-content-small units"> <div class="post-entry post-entry-type-page post-entry-3400"> <div class="entry-content-wrapper clearfix"> <div style="padding-bottom:10px;color:#ffffff;" class="av-special-heading av-special-heading-h2 custom-color-heading blockquote modern-quote modern-centered avia-builder-el-1 avia-builder-el-no-sibling "> <h2 class="av-special-heading-tag" itemprop="headline"> <?php if (is_category( )) { $cat = get_query_var('cat'); $mycat = get_category ($cat); echo $mycat->name . ' '; } elseif (is_date()) { echo single_month_title(' ') . ' '; } ?> </h2> <div class="special-heading-border"> <div class="special-heading-inner-border" style="border-color:#ffffff"> </div> </div> </div> </div> </div> </main><!-- close content main element --> </div> </div> <div class='container template-blog '> <main class='content <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'post'));?>> <div class="category-term-description"> <?php echo term_description(); ?> </div> <?php $avia_config['blog_style'] = apply_filters('avf_blog_style', avia_get_option('blog_style','multi-big'), 'archive'); if($avia_config['blog_style'] == 'blog-grid') { global $posts; $post_ids = array(); foreach($posts as $post) $post_ids[] = $post->ID; if(!empty($post_ids)) { $atts = array( 'type' => 'grid', 'items' => get_option('posts_per_page'), 'columns' => 4, 'class' => 'avia-builder-el-no-sibling', 'paginate' => 'yes', 'use_main_query_pagination' => 'yes', 'custom_query' => array( 'post__in'=>$post_ids, 'post_type'=>get_post_types() ) ); $blog = new avia_post_slider($atts); $blog->query_entries(); echo "<div class='entry-content-wrapper'>".$blog->html()."</div>"; } else { get_template_part( 'includes/loop', 'index' ); } } else { /* Run the loop to output the posts. * If you want to overload this in a child theme then include a file * called loop-index.php and that will be used instead. */ $more = 0; get_template_part( 'includes/loop', 'index' ); } ?> <!--end content--> </main> <?php //get the sidebar $avia_config['currently_viewing'] = 'blog'; get_sidebar(); ?> </div><!--end container--> </div><!-- close default .container_wrap element --> <?php get_footer(); ?>
- This reply was modified 9 years ago by Spiv.
November 15, 2015 at 3:01 am #535991This is sort-of expected, you can’t render a fullwidth submenu via
do_shortcode
, you’d probably need to replace that code with the finalized, raw HTML:<div id="sub_menu1" class="av-submenu-container main_color av-sticky-submenu container_wrap sidebar_right" style="z-index: 301; top: 111px; position: fixed;"><div class="container av-menu-mobile-active "><a href="#" class="mobile_menu_toggle" aria-hidden="true" data-av_icon="" data-av_iconfont="entypo-fontello"><span class="av-current-placeholder">Menu</span></a><ul id="menu-about-eswi" class="av-subnav-menu av-submenu-pos-center"><li id="menu-item-3575" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-top-level menu-item-top-level-1"><a href="http://staging.eswi2.studioplum.prvw.eu/knowledge-center/home/about-eswi/our-motivation/" itemprop="url"><span class="avia-bullet"></span><span class="avia-menu-text">Our motivation</span><span class="avia-menu-fx"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></span></a></li> <li id="menu-item-3576" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-top-level menu-item-top-level-2"><a href="http://staging.eswi2.studioplum.prvw.eu/knowledge-center/home/about-eswi/members-and-associate-members/" itemprop="url"><span class="avia-bullet"></span><span class="avia-menu-text">Members and associate members</span><span class="avia-menu-fx"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></span></a></li> <li id="menu-item-3577" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-top-level menu-item-top-level-3"><a href="http://staging.eswi2.studioplum.prvw.eu/knowledge-center/home/about-eswi/partner-organizations/" itemprop="url"><span class="avia-bullet"></span><span class="avia-menu-text">Partner organizations</span><span class="avia-menu-fx"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></span></a></li> <li id="menu-item-3578" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-top-level menu-item-top-level-4"><a href="http://staging.eswi2.studioplum.prvw.eu/knowledge-center/home/about-eswi/resources/" itemprop="url"><span class="avia-bullet"></span><span class="avia-menu-text">Resources</span><span class="avia-menu-fx"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></span></a></li> <li id="menu-item-3579" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-top-level menu-item-top-level-5"><a href="http://staging.eswi2.studioplum.prvw.eu/knowledge-center/home/about-eswi/flyer/" itemprop="url"><span class="avia-bullet"></span><span class="avia-menu-text">Flyer</span><span class="avia-menu-fx"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></span></a></li> <li id="menu-item-3580" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-top-level menu-item-top-level-6"><a href="http://staging.eswi2.studioplum.prvw.eu/knowledge-center/home/about-eswi/activities/" itemprop="url"><span class="avia-bullet"></span><span class="avia-menu-text">Activities</span><span class="avia-menu-fx"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></span></a></li> </ul></div></div>
Regards,
JosueNovember 16, 2015 at 12:06 pm #536437Hmm, unfortunately this method makes it very cumbersome to maintain the site…
Actually the main reason is the secondary topmenu doesn’t have responsive behaviour. Otherwise I could use that as main menu. I’m really stuck with Enfold when using a main and sub menu and have consistency through all pages / archives. One way or another I face a wall.
The full width submenu is great, but what’s the use when it disappears on archive pages and blog index, losing all navigation of this menu … :s.November 18, 2015 at 9:30 am #537902Hi!
The initial purpose of the full width submenu element is to support the main menu or navigation for specific pages. It’s better NOT to use it as a main navigation for your pages. If you really want it to display on archive pages, please follow the solution provided above.
Best regards,
IsmaelApril 9, 2016 at 1:33 am #610474I was able to figure this one out by wrapping a wp_nav_menu tag up in the fullwidth submenu HTML:
<div class="clear"></div> <div id="sub_menu1" class="av-submenu-container alternate_color blog_menu av-sticky-submenu container_wrap fullsize" style="z-index:301"><div class="container av-menu-mobile-active "><a href="#" class="mobile_menu_toggle" aria-hidden="true" data-av_icon="" data-av_iconfont="entypo-fontello"><span class="av-current-placeholder">Menu</span></a> <?php wp_nav_menu( array( 'menu' => 'Blog Menu', 'menu_id' => 'menu-blog-menu', 'menu_class' => 'av-subnav-menu av-submenu-pos-left', 'container' => false, 'fallback_cb' => false ) ); ?> </div></div> <div class="sticky_placeholder"></div>
April 9, 2016 at 8:04 am #610522 -
AuthorPosts
- You must be logged in to reply to this topic.