Skip to content

Commit

Permalink
Blank menu fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
marcperel committed Apr 18, 2016
1 parent b4df696 commit f313417
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
8 changes: 5 additions & 3 deletions builder.php
Expand Up @@ -24,9 +24,11 @@
</div>
<?php do_action('layers_after_post_loop'); ?>
</div>
<?php } else {
dynamic_sidebar( 'obox-layers-builder-' . $post->ID );
}
<?php } else { ?>
<div id="<?php echo 'obox-layers-builder-' . $post->ID; ?>">
<?php dynamic_sidebar( 'obox-layers-builder-' . $post->ID ); ?>
</div>
<?php }

do_action('after_layers_builder_widgets');

Expand Down
21 changes: 17 additions & 4 deletions core/helpers/template.php
Expand Up @@ -454,7 +454,7 @@ function layers_apply_customizer_styles() {
'background-color' => $main_color,
)
));

// Content - Links
layers_inline_styles( array(
'selectors' => array( '.copy a:not(.button)', '.story a:not(.button)' ),
Expand All @@ -470,7 +470,7 @@ function layers_apply_customizer_styles() {
'border-bottom-color' => layers_too_light_then_dark( $main_color ),
),
));

// Debugging:
global $wp_customize;
if ( $wp_customize && ( ( bool ) layers_get_theme_mod( 'dev-switch-button-css-testing' ) ) ) {
Expand Down Expand Up @@ -1560,7 +1560,6 @@ function layers_excerpt_action() {
*/
if( !function_exists( 'layers_header_meta' ) ) {
function layers_header_meta(){ ?>
<head prefix="og: http://ogp.me/ns#">
<?php if( is_single() ) { ?>
<meta property="og:title" content="<?php the_title(); ?>" />
<meta property="og:type" content="website" />
Expand All @@ -1580,4 +1579,18 @@ function layers_header_meta(){ ?>
<?php }
}
}
add_action( 'wp_head', 'layers_header_meta' );
add_action( 'wp_head', 'layers_header_meta' );


/**
* Set Blank menu function which is used as a fallback in the Layers Menus
*
* @return string Blank space
*
*/

if( !function_exists( 'layers_blank_menu' ) ) {
function layers_blank_menu(){
echo '';
}
}
4 changes: 2 additions & 2 deletions partials/header-centered.php
Expand Up @@ -7,7 +7,7 @@
*/ ?>
<div class="inline-left-nav">
<nav class="nav nav-horizontal">
<?php wp_nav_menu( array( 'theme_location' => LAYERS_THEME_SLUG . '-primary' ,'container' => FALSE, 'fallback_cb' => 'layers_menu_fallback' )); ?>
<?php wp_nav_menu( array( 'theme_location' => LAYERS_THEME_SLUG . '-primary' ,'container' => FALSE, 'fallback_cb' => 'layers_menu_fallback' ) ); ?>
</nav>
</div>

Expand All @@ -17,7 +17,7 @@

<div class="inline-right-nav">
<?php do_action( 'layers_before_header_nav' ); ?>
<?php wp_nav_menu( array( 'theme_location' => LAYERS_THEME_SLUG . '-primary-right' ,'container' => 'nav', 'container_class' => 'nav nav-horizontal', 'fallback_cb' => create_function('', 'echo "&nbsp";') ) ); ?>
<?php wp_nav_menu( array( 'theme_location' => LAYERS_THEME_SLUG . '-primary-right' ,'container' => 'nav', 'container_class' => 'nav nav-horizontal', 'fallback_cb' => 'layers_blank_menu' ) ); ?>
<?php get_template_part( 'partials/responsive' , 'nav-button' ); ?>
<?php do_action( 'layers_after_header_nav' ); ?>
</div>
2 changes: 1 addition & 1 deletion sidebar-off-canvas.php
Expand Up @@ -5,7 +5,7 @@
</a>

<div class="content nav-mobile clearfix">
<?php wp_nav_menu( array( 'theme_location' => LAYERS_THEME_SLUG . '-primary' ,'container' => 'nav', 'container_class' => 'nav nav-vertical', 'fallback_cb' => create_function('', 'echo "&nbsp";') ) ); ?>
<?php wp_nav_menu( array( 'theme_location' => LAYERS_THEME_SLUG . '-primary' ,'container' => 'nav', 'container_class' => 'nav nav-vertical', 'fallback_cb' => 'layers_blank_menu' ) ); ?>
</div>
<?php dynamic_sidebar( LAYERS_THEME_SLUG . '-off-canvas-sidebar' ); ?>
</div>

0 comments on commit f313417

Please sign in to comment.