-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
122 lines (106 loc) · 3.57 KB
/
header.php
File metadata and controls
122 lines (106 loc) · 3.57 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php if ( !defined('ABSPATH') ) die();
/**
* The header for our theme.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage FS_Onepage
* @since 1.0
* @version 1.0
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php endif; ?>
<?php wp_head(); ?>
<script>
var theme_path = '<?php echo FS_THEME_URL; ?>';
</script>
</head>
<?php
$head1 = get_theme_mod('layout_option') == 'version1';
$head2 = get_theme_mod('layout_option') == 'version2';
$sidebar = get_theme_mod('layout_sidebar') == 'sidebar';
$topbar = get_theme_mod('layout_sidebar') == 'topbar';
if ( $head1 ) { $header = 'header-v1'; }
else if ( $head2 ) { $header = 'header-v2'; }
else { $header = 'header-v1'; }
if ( $sidebar ) { $aside = 'posts-sidebar'; }
else if ( $topbar ) { $aside = 'posts-topbar'; }
else { $aside = 'posts-sidebar'; }
?>
<body <?php body_class(); ?>>
<div id="wrapper" class="<?php echo $header.' '.$aside; ?>">
<?php // The Skiplinks ?>
<?php if ( ! is_page_template( 'pagecustom-maintenance.php' ) ) { ?>
<div class="skiplinks">
<a href="#site_content"><?php esc_html_e('Go to main content', 'fs-onepage'); ?></a>
</div>
<?php } ?>
<header role="banner" id="site_head">
<div class="inner">
<?php if ( ! is_front_page() && ! is_page_template( 'pagecustom-maintenance.php' ) ) { ?>
<?php get_template_part('template-parts/header', 'brand'); ?>
<a href="<?php echo FS_HOME; ?>" class="back-home" title="<?php esc_attr_e('Go to Home Page', 'fs-onepage'); ?>">
<img src="<?php echo FS_THEME_URL; ?>/img/icon-arrow-black.svg" alt="">
</a>
<?php } ?>
<?php if ( ! is_page_template( 'pagecustom-maintenance.php' ) ) { ?>
<nav class="site-nav onepage-nav" role="navigation" aria-label="<?php esc_attr_e('Main menu', 'fs-onepage'); ?>">
<?php
$frontpage = get_option( 'page_on_front' );
$pageargs = array(
'posts_per_page' => -1,
'post_type' => 'page',
'post__not_in' => array($frontpage),
'meta_query' =>
array(
'relation' => 'OR',
array(
array(
'key' => '_wp_page_template',
'value' => 'pagecustom-standalone.php',
'compare' => '!=',
),
array(
'key' => '_wp_page_template',
'value' => 'pagecustom-maintenance.php',
'compare' => '!=',
),
array(
'key' => '_wp_page_template',
'value' => 'pagecustom-intro.php',
'compare' => '!=',
),
),
array(
'key' => '_wp_page_template',
'compare' => 'NOT EXISTS',
),
),
);
$onepage = new WP_Query($pageargs);
if ($onepage->have_posts()) : ?>
<ul class="onepage-menu">
<?php while ($onepage->have_posts()) : $onepage->the_post(); ?>
<li>
<?php if ( ! is_front_page() ) { ?>
<a href="<?php echo FS_HOME; ?>#<?php fs_slug(); ?>"><?php the_title(); ?></a>
<?php } else { ?>
<a href="#<?php fs_slug(); ?>"><?php the_title(); ?></a>
<?php } ?>
</li>
<?php endwhile; wp_reset_postdata(); ?>
</ul>
<?php endif; ?>
</nav>
<?php } ?>
</div>
</header>
<main class="content-area" role="main" id="site_content">