This commit is contained in:
Egor Svitin
2019-03-07 14:47:01 +02:00
parent af2e76536f
commit 7f32720ded

View File

@@ -5,6 +5,8 @@ require_once 'inc/walker-nav-menu.php';
$urlParts = parse_url(home_url());
$scheme = isset($urlParts['scheme']) ? $urlParts['scheme'] . '://' : '';
$baseTemplate = basename( get_page_template() );
$host = isset($urlParts['host']) ? $urlParts['host'] : '';
if (defined('LAWCARTA_SUBDOMAIN')) {
$hostParts = explode('.', $host);
@@ -43,7 +45,12 @@ $lawCartaUrl = "$scheme$host$port";
<meta name="msapplication-config" content="<?= get_theme_file_uri('/assets/img/favicon/browserconfig.xml'); ?>">
<meta name="theme-color" content="#ffffff">
<?php if ($baseTemplate == 'page_home.php'):?>
<script type="application/javascript">
var isHomeTemplate = true;
var lawCartaDomain = '<?= $lawCartaUrl?>';
</script>
<?php endif;?>
<?php wp_head(); ?>
</head>
@@ -82,6 +89,9 @@ $lawCartaUrl = "$scheme$host$port";
$('.guest-data').css('display', 'inline-block');
} else {
$('.home-label').text('Dashboard').attr('href', '<?= $lawCartaUrl?>/dashboard');
if (typeof isHomeTemplate != 'undefined' && isHomeTemplate === true) {
window.location.href = lawCartaDomain + '/dashboard';
}
}
}
});