This commit is contained in:
gregory-p
2019-03-22 14:03:07 +03:00
parent 7641ea1aa0
commit fb84f44f97
4 changed files with 35 additions and 33 deletions

View File

@@ -2,33 +2,6 @@
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);
if (count($hostParts) === 3) {
array_shift($hostParts);
}
if (!empty(LAWCARTA_SUBDOMAIN)) {
array_unshift($hostParts, LAWCARTA_SUBDOMAIN);
}
$host = implode('.', $hostParts);
}
$port = isset($urlParts['port']) ? $urlParts['port'] : '';
if (defined('LAWCARTA_PORT')) {
$port = LAWCARTA_PORT;
}
if (!empty($port)) {
$port = ':' . $port;
}
$lawCartaUrl = "$scheme$host$port";
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
@@ -48,7 +21,7 @@ $lawCartaUrl = "$scheme$host$port";
<?php if ($baseTemplate == 'page_home.php'):?>
<script type="application/javascript">
var isHomeTemplate = true;
var lawCartaDomain = '<?= $lawCartaUrl?>';
var lawCartaDomain = '<?= get_lawcarta_url()?>';
</script>
<?php endif;?>