-
AuthorPosts
-
June 15, 2015 at 11:13 pm #303028
I have a custom theme for a category using the file category-25.php in a child theme.
My menu isn’t appearing in this custom category theme but it appears fine in my single post customised theme file. single-destination.php that i use for a custom post type.How can i get it to appear? I’m using the Ethos framework.
June 15, 2015 at 11:17 pm #303031This reply has been marked as private.June 16, 2015 at 5:39 am #303310Hi There,
Thanks for writing in.
Please try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.
If it doesn’t work, 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 / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.June 16, 2015 at 11:51 am #303720This reply has been marked as private.June 16, 2015 at 12:14 pm #303747This reply has been marked as private.June 16, 2015 at 1:55 pm #303874This reply has been marked as private.June 16, 2015 at 1:55 pm #303875This reply has been marked as private.June 16, 2015 at 7:18 pm #304209Hey there,
Since X is a multi-design theme, its structure is not the same as a typical theme. Please see https://community.theme.co//kb/customization-best-practices/ to learn how to customize X. We’d love to help you with this however, this involves custom development and a plugin therefore it falls outside the scope of our support. You might want to contact our trusted partners who caters X setup and customization needs. Please see https://theme.co/x/member/custom-development/.
Thank you for understanding.
June 16, 2015 at 9:41 pm #304264ok fixed it.
For anyone having problems with menu’s not appearing on custom category theme pages or child category themes using this plugin
https://wordpress.org/plugins/category-template-hierarchy/
and the Ethos layout
Here’s a solution.
function getMainMenu($menulocation){ $locations = get_nav_menu_locations(); $menuItems = wp_get_nav_menu_items( $locations[ $menulocation ] ); if(empty($menuItems)) return false; else{ wp_nav_menu(array('theme_location' => $menulocation, 'container'=> false, 'menu_class'=> 'x-nav sf-menu')); return true; } }
in your functions.php and i’m calling a custom header in my theme
<?php get_header('custom');?>
in header-custom.php
<?php x_get_view( x_get_stack(), 'wp', 'headercustom' ); ?>
in wp-headercustom.php in my child ethos i’m using
<?php // ============================================================================= // VIEWS/ETHOS/WP-HEADERCUSTOM.PHP // ----------------------------------------------------------------------------- // Header output for Ethos. // ============================================================================= ?> <?php x_get_view( 'global', '_header' ); ?> <?php x_get_view( 'global', '_slider-above' ); ?> <header class="<?php x_masthead_class(); ?>" role="banner"> <?php x_get_view( 'ethos', '_post', 'carousel' ); ?> <?php x_get_view( 'global', '_topbar' ); ?> <?php x_get_view( 'global', '_navbarcustom' ); ?> <?php x_get_view( 'ethos', '_breadcrumbs' ); ?> </header> <?php x_get_view( 'global', '_slider-below' ); ?> <?php x_get_view( 'ethos', '_landmark-header' ); ?>
and then the same _nav-primarycustom.php in global
<?php // ============================================================================= // VIEWS/GLOBAL/_NAV-PRIMARYCUSTOM.PHP // ----------------------------------------------------------------------------- // Outputs the primary nav. // ============================================================================= if(!getMainMenu('primary')){ $backup = $wp_query; $wp_query = NULL; $wp_query = new WP_Query(array('post_type' => 'post')); ?> <a href="#" class="x-btn-navbar collapsed" data-toggle="collapse" data-target=".x-nav-wrap.mobile"> <i class="x-icon-bars"></i> <span class="visually-hidden"><?php _e( 'Navigation', '__x__' ); ?></span> </a> <nav class="x-nav-wrap desktop" role="navigation"> <?php getMainMenu('primary'); ?> <?php /*wp_nav_menu( array( 'theme_location' => 'primary', 'container' => false, 'menu_class' => 'x-nav sf-menu' ) );*/ ?> </nav> <div class="x-nav-wrap mobile collapse"> <?php /* wp_nav_menu( array( 'theme_location' => 'primary', 'container' => false, 'menu_class' => 'x-nav sf-menu' ) );*/ ?> <?php getMainMenu('primary'); ?> </div> <?php $wp_query = $backup; } ?>
adapted from this forum post.
https://wordpress.org/support/topic/wp-nav-menu-dissapears-in-category-pages-1Still no idea why this isn’t working with Ethos by default but it is with this fix.
June 17, 2015 at 6:14 am #304607Thanks for sharing.
-
AuthorPosts