-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathheader.php
More file actions
executable file
·30 lines (28 loc) · 897 Bytes
/
header.php
File metadata and controls
executable file
·30 lines (28 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
// Provide a short circuit to prevent showing the footer in certain conditions
$show_header = apply_filters( 'rh/header/show_header', true );
if ( ! $show_header ) {
return;
}
// Provide a way to disable showing the main nav in certain situations
$show_nav = apply_filters( 'rh/header/show_nav', true );
$main_nav = '';
$main_nav_ctas = '';
if ( $show_nav ) {
$main_nav_args = array(
'theme_location' => 'main',
'container' => false,
'items_wrap' => '%3$s', // Prevents wrapping in any markup
'echo' => false,
);
$main_nav = wp_nav_menu( $main_nav_args );
wp_enqueue_script( 'rh-main-nav' );
}
$context = array(
'site_url' => get_site_url(),
'logo' => '',
'main_nav' => $main_nav,
'close_icon' => RH_SVG::get_icon( 'close' ),
'menu_icon' => RH_SVG::get_icon( 'menu' ),
);
Sprig::out( 'header.twig', $context );