Skip to content

Commit 5f6c57c

Browse files
authored
Merge pull request #381 from BeAPI/fix/less-complex-html-markup
Less complex HTML markup
2 parents fa18347 + e4249eb commit 5f6c57c

File tree

5 files changed

+53
-64
lines changed

5 files changed

+53
-64
lines changed

components/parts/common/footer.php

Lines changed: 0 additions & 6 deletions
This file was deleted.

components/parts/common/header.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

components/parts/common/skip-links.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

footer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
</main>
2-
<?php
3-
get_template_part( 'components/parts/common/footer' );
4-
wp_footer();
5-
?>
2+
<footer id="footer" class="footer" role="contentinfo" aria-label="<?php esc_attr_e( 'Footer', 'beapi-frontend-framework' ); ?>">
3+
4+
</footer>
5+
<?php wp_footer(); ?>
66
</body>
77
</html>

header.php

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<?php
2+
use BEA\Theme\Framework\Helpers\Custom_Menu_Walker;
3+
?>
14
<!DOCTYPE html>
25
<html class="no-js no-js-animation" <?php language_attributes(); ?>>
36
<head>
@@ -27,10 +30,52 @@ function replaceHtmlClass(regexp, str) {
2730
</head>
2831
<body <?php body_class(); ?>>
2932
<?php wp_body_open(); ?>
30-
<?php
31-
get_template_part( 'components/parts/common/skip-links' );
32-
get_template_part( 'components/parts/common/header' );
33-
?>
33+
<nav class="skip-links skip-links--hidden" role="navigation" aria-label="<?php esc_attr_e( 'Fast access links', 'beapi-frontend-framework' ); ?>">
34+
<ul>
35+
<li>
36+
<a href="#menu"><?php esc_html_e( 'Main navigation menu', 'beapi-frontend-framework' ); ?></a>
37+
</li>
38+
<li>
39+
<a href="#content"><?php esc_html_e( 'Main content', 'beapi-frontend-framework' ); ?></a>
40+
</li>
41+
<li>
42+
<a href="#footer"><?php esc_html_e( 'Footer', 'beapi-frontend-framework' ); ?></a>
43+
</li>
44+
</ul>
45+
</nav>
46+
<header id="header" class="header" role="banner" aria-label="<?php esc_attr_e( 'Header', 'beapi-frontend-framework' ); ?>">
47+
<div class="header__inner">
48+
<div class="container">
49+
<a class="header__logo-link" href="<?php echo esc_url( home_url( '/' ) ); ?>">
50+
<strong><?php echo esc_html( get_bloginfo( 'name' ) ); ?></strong>
51+
<span class="sr-only"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></span>
52+
</a>
53+
<?php if ( has_nav_menu( 'menu-main' ) ) : ?>
54+
<button class="header__menu-toggle" aria-expanded="false" aria-controls="menu">
55+
<span></span>
56+
<span class="sr-only aria-expanded-false-text"><?php esc_html_e( 'Open the menu', 'beapi-frontend-framework' ); ?></span>
57+
<span class="sr-only aria-expanded-true-text"><?php esc_html_e( 'Close the menu', 'beapi-frontend-framework' ); ?></span>
58+
</button>
59+
60+
<nav id="menu" class="header__menu" aria-label="<?php esc_attr_e( 'Main navigation', 'beapi-frontend-framework' ); ?>" role="navigation">
61+
<div>
62+
<?php
63+
wp_nav_menu(
64+
[
65+
'theme_location' => 'menu-main',
66+
'container' => 'none',
67+
'menu_class' => 'header__menu-list',
68+
'fallback_cb' => false,
69+
'walker' => new Custom_Menu_Walker(),
70+
]
71+
);
72+
?>
73+
</div>
74+
</nav>
75+
<?php endif; ?>
76+
</div>
77+
</div>
78+
</header>
3479
<main id="content" role="main" tabindex="-1" aria-label="<?php esc_attr_e( 'Main content', 'beapi-frontend-framework' ); ?>">
3580
<?php
3681
if ( ! is_front_page() && ! is_search() ) {

0 commit comments

Comments
 (0)