Merge pull request #2557 from gregory-p/wordpress

Wordpress
This commit is contained in:
bivis
2019-03-22 13:13:13 +02:00
committed by GitHub
6 changed files with 41 additions and 40 deletions

View File

@@ -11,7 +11,7 @@ require_once 'inc/walker-nav-menu.php';
<div class="title">Menu</div>
<a href="/features">Features</a>
<a href="/about-us">About Us</a>
<a href="/privacy-policy">Private Policy</a>
<a href="/privacy-policy">Privacy Policy</a>
<a href="/terms-of-use">Terms of Use</a>
<a href="/contact-us">Contact Us</a>
<a href="/faq-page">FAQ</a>
@@ -23,7 +23,7 @@ require_once 'inc/walker-nav-menu.php';
</div>
<div class="fm-col hide-sm">
<div class="title">Legal</div>
<a href="/privacy-policy">Private Policy</a>
<a href="/privacy-policy">Privacy Policy</a>
<a href="/terms-of-use">Terms of Use</a>
</div>
<div class="fm-col hide-sm">

View File

@@ -182,3 +182,32 @@ function my_filter_post_where( $where) {
return $where;
}
function get_lawcarta_url(){
$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;
}
return "$scheme$host$port";
}

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;?>
@@ -77,14 +50,14 @@ $lawCartaUrl = "$scheme$host$port";
}
?>
</div>
<iframe src="<?= $lawCartaUrl ?>/menu" style="display: none;"></iframe>
<iframe src="<?= get_lawcarta_url()?>/menu" style="display: none;"></iframe>
<script type="application/javascript">
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
var eventer = window[eventMethod];
var messageEvent = eventMethod === "attachEvent" ? "onmessage" : "message";
eventer(messageEvent, function (ev) {
if (ev.origin.indexOf('<?= $lawCartaUrl ?>') !== -1) {
if (ev.origin.indexOf('<?= get_lawcarta_url()?>') !== -1) {
// document.getElementById('header-menu').insertAdjacentHTML('beforeend', ev.data);
$('body').append('<div id="header-parser"></div>');
@@ -103,7 +76,7 @@ $lawCartaUrl = "$scheme$host$port";
if ($('#is-guest').text() == 'true') {
$('.guest-data').css('display', 'inline-block');
} else {
$('.home-label').text('Dashboard').attr('href', '<?= $lawCartaUrl?>/dashboard');
$('.home-label').text('Dashboard').attr('href', '<?= get_lawcarta_url()?>/dashboard');
if (typeof isHomeTemplate != 'undefined' && isHomeTemplate === true) {
window.location.href = lawCartaDomain + '/dashboard';
}

View File

@@ -93,8 +93,8 @@ if ($tIds !== false) {
<div class="cont">
<div class="sb-head">Interested? Get to know more</div>
<div class="buttons">
<a href="#" class="button xxl mp-top-right">Request a demo</a>
<a href="#" class="button xxl mp-top-left">Sign Up For Free</a>
<a href="/contact-us" class="button xxl mp-top-right">Request a demo</a>
<a href="<?= get_lawcarta_url()?>/user/registration" class="button xxl mp-top-left">Sign Up For Free</a>
</div>
</div>
</div>
@@ -103,4 +103,3 @@ if ($tIds !== false) {
<?php
get_footer();

View File

@@ -43,8 +43,8 @@ $post = $posts[0];
<div class="cont">
<div class="sb-head">Interested? Get to know more</div>
<div class="buttons">
<a href="#" class="button xxl mp-top-right">Request a demo</a>
<a href="#" class="button xxl mp-top-left">Sign Up For Free</a>
<a href="/contact-us" class="button xxl mp-top-right">Request a demo</a>
<a href="<?= get_lawcarta_url()?>/user/registration" class="button xxl mp-top-left">Sign Up For Free</a>
</div>
</div>
</div>

View File

@@ -5,7 +5,7 @@
<div class="title">Menu</div>
<a href="/features">Features</a>
<a href="/about-us">About Us</a>
<a href="/privacy-policy">Private Policy</a>
<a href="/privacy-policy">Privacy Policy</a>
<a href="/terms-of-use">Terms of Use</a>
<a href="/contact-us">Contact Us</a>
<a href="/faq-page">FAQ</a>
@@ -17,7 +17,7 @@
</div>
<div class="fm-col hide-sm">
<div class="title">Legal</div>
<a href="/privacy-policy">Private Policy</a>
<a href="/privacy-policy">Privacy Policy</a>
<a href="/terms-of-use">Terms of Use</a>
</div>
<div class="fm-col hide-sm">