This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
header.php
63 lines (54 loc) · 2.24 KB
/
header.php
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
<?php
$langs = ["ru","fr","zh","pt","ko_KR","ja","es"];
$pathArray = explode('/', $_SERVER[REQUEST_URI]);
?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js no-svg">
<head>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-91560402-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-91560402-2');
</script>
<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 wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentyseventeen' ); ?></a>
<header id="masthead" class="site-header" role="banner">
<?php get_template_part( 'template-parts/header/header', 'image' ); ?>
<?php if ( has_nav_menu( 'top' ) ) : ?>
<div class="navigation-top">
<div class="wrap">
<?php get_template_part( 'template-parts/navigation/navigation', 'top' ); ?>
</div><!-- .wrap -->
</div><!-- .navigation-top -->
<?php endif; ?>
<?php
$isLang = $pathArray[1];
if (!in_array($isLang, $langs)) {
$pageslug = $_SERVER[REQUEST_URI];
} else {
$pageslug = substr($_SERVER[REQUEST_URI], strlen($isLang)+1);
}
?>
<div class="dropdown">
<button>Language</button>
<ul class="dropdown-menu">
<li><a href="<?php echo $pageslug ?>">English</a></li>
<li><a href="<?php echo '/ru' . $pageslug ?>">Русский</a></li>
<li><a href="<?php echo '/fr' . $pageslug ?>">Français</a></li>
<li><a href="<?php echo '/zh' . $pageslug ?>">中文</a></li>
<li><a href="<?php echo '/pt' . $pageslug ?>">Português</a></li>
<li><a href="<?php echo '/ko_KR' . $pageslug ?>">한국어</a></li>
<li><a href="<?php echo '/ja' . $pageslug ?>">日本語</a></li>
<li><a href="<?php echo '/es' . $pageslug ?>">Español</a></li>
</ul>
</div>
</header><!-- #masthead -->
<div class="site-content-contain">
<div id="content" class="site-content">