header.php 1.38 KB
Newer Older
1
 <?php
agnez's avatar
agnez committed
2 3 4 5 6 7 8 9 10 11 12 13 14
/**
 * This file content is situated in /lib/templates/structure/header.php and should
 * strictly be overwritten via your child theme.
 *
 * We strongly recommend to read Beans documentation to find out more how to
 * customize Beans theme.
 *
 * @author Beans
 * @link   http://www.getbeans.io
 */

// Template situated in /lib/templates/structure/header.php

15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
// sticky menu
//beans_remove_markup( 'beans_site' );
beans_add_attribute( 'beans_primary_menu', 'data-uk-sticky', 'top:0' );
beans_add_attribute('beans_header', 'data-uk-sticky', '{top:0}');

// Add secondary menu
beans_add_smart_action( 'beans_header_append_markup', 'sub_menu' );
function sub_menu() {?>
	<div class="sousmenu uk-container uk-container-center uk-hidden-small">
		<div class="uk-grid" style="clear: both;"><?php
		related_pages();
	?></div>
	</div><?php
}

// Add secondary menu
beans_add_smart_action( 'beans_header_before_markup', 'secondary_menu' );
function secondary_menu() {
	if ( has_nav_menu( 'secondary-menu' ) ) { // only show if the secondary-menu location has a menu assigned
		wp_nav_menu( array( 
			'menu' => 'Secondary',
			'menu_class' => 'uk-subnav uk-visible-larget',
			'container' => 'nav',
			'container_class' => 'uk-container uk-container-center uk-navbar uk-hidden-small',
			'theme_location' => 'secondary-menu',
			'beans_type' => 'navbar'
		) );
	}
} 

agnez's avatar
agnez committed
45 46
beans_load_default_template( __FILE__ );
?>