Skip to content

Commit

Permalink
Fixed header menu
Browse files Browse the repository at this point in the history
  • Loading branch information
apzeero committed May 11, 2019
1 parent 12981f3 commit e223f38
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 33 deletions.
43 changes: 15 additions & 28 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,34 @@

<body <?php body_class(); ?>>

<a class="uk-invisible" href="#main-content" aria-hidden="false"><?php esc_html_e( 'Skip to content', 'teamwpugph' ); ?></a>
<a class="screen-reader-text" href="#main-content"><?php esc_html_e( 'Skip to content', 'teamwpugph' ); ?></a>

<!--HEADER-->
<header data-uk-sticky="sel-target: .uk-navbar-container; cls-active: uk-navbar-sticky; bottom: #transparent-sticky-navbar">
<header class="nav uk-sticky uk-sticky-below uk-sticky-fixed uk-box-shadow-medium" data-uk-sticky="cls-active: uk-background-default; top: 100vh; animation: uk-animation-slide-top; show-on-up: true;">
<div class="uk-container">
<nav class="uk-navbar-container uk-navbar-transparent" data-uk-navbar>
<nav class="uk-navbar uk-navbar-container uk-navbar-transparent" data-uk-navbar>
<div class="uk-navbar-left">
<a class="uk-navbar-item uk-logo" href="<?php echo home_url(); ?>">
<?php echo the_custom_logo(); ?>
</a>
<div class="uk-navbar-item uk-padding-remove-horizontal">
<a class="uk-navbar-item uk-logo" href="<?php echo home_url(); ?>">
<?php
if ( has_custom_logo() ) {
echo the_custom_logo();
} else {
_e( 'Logo', 'teamwpugph' );
}
?>
</a>
</div>
</div>
<?php
wp_nav_menu( array(
'theme_location' => 'primary-menu',
'container_class' => 'uk-navbar-center',
'container_class' => 'uk-navbar-right',
'menu_class' => 'uk-navbar-nav',
'items_wrap' => '<ul class="%2$s">%3$s</ul>',
'walker' => new UIKit3_Walker_Nav_Menu(),
) );
?>
<div class="uk-navbar-right">
<ul class="uk-navbar-nav">
<li>
<a href="#" data-uk-icon="icon:user"></a>
<div class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left">
<ul class="uk-nav uk-navbar-dropdown-nav">
<li class="uk-nav-header uk-text-small uk-text-primary">YOUR ACCOUNT</li>
<li><a href="#"><span data-uk-icon="icon: info"></span> Summary</a></li>
<li><a href="#"><span data-uk-icon="icon: refresh"></span> Edit</a></li>
<li><a href="#"><span data-uk-icon="icon: settings"></span> Configuration</a></li>
<li class="uk-nav-divider"></li>
<li><a href="#"><span data-uk-icon="icon: image"></span> Your Pictures</a></li>
<li class="uk-nav-divider"></li>
<li><a href="#"><span data-uk-icon="icon: sign-out"></span> Logout</a></li>

</ul>
</div>
</li>
<li class="uk-hidden@m"><a class="uk-navbar-toggle" data-uk-toggle data-uk-navbar-toggle-icon href="#offcanvas-nav"></a></li>
</ul>
</div>
</nav>
</div>
</header>
Expand Down
10 changes: 5 additions & 5 deletions inc/custom-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function start_lvl( &$output, $depth = 0, $args = array() )
}
$indent = str_repeat( $t, $depth );

$output .= $indent . '<div class="uk-navbar-dropdown">' . "\n";
$output .= $indent . '<div class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left">' . "\n";
$output .= $indent . "\t" . '<ul class="uk-nav uk-navbar-dropdown-nav">' . "\n";
}

Expand Down Expand Up @@ -76,7 +76,7 @@ function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
$t = "\t";
$n = "\n";
}
$indent = ( $depth ) ? str_repeat( $t, $depth ) : '';
$indent = ( $depth ) ? str_repeat( $t, $depth ) : '';
$item_output = '';

$object = $item->object;
Expand All @@ -101,13 +101,13 @@ function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
}
}

$item_output .= '<li class="' . implode(' ', $classes) . '">';
$item_output .= $indent . '<li class="' . implode(' ', $classes) . '">';

//Add SPAN if no Permalink
if ($permalink && $permalink != '#') {
$item_output .= '<a href="' . $permalink . '">';
} else {
$item_output .= '<span>';
$item_output .= '<a href="#">';
}
$item_output .= $title;

Expand All @@ -120,7 +120,7 @@ function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
if ($permalink && $permalink != '#') {
$item_output .= '</a>';
} else {
$item_output .= '</span>';
$item_output .= '</a>';
}

/**
Expand Down

0 comments on commit e223f38

Please sign in to comment.