forked from LiveCarta/LiveCartaWP
@@ -94,6 +94,24 @@ add_filter('wp_setup_nav_menu_item', function ($menu_item)
|
|||||||
return $menu_item;
|
return $menu_item;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
add_action('init','add_lctc_val');
|
||||||
|
function add_lctc_val() {
|
||||||
|
global $wp;
|
||||||
|
$wp->add_query_var('lctc');
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_canonocal_url() {
|
||||||
|
$uri = explode('?', $_SERVER['REQUEST_URI']);
|
||||||
|
if (isset($uri[1])) {
|
||||||
|
parse_str($uri[1], $params);
|
||||||
|
if (isset($params['lctc'])) {
|
||||||
|
unset($params['lctc']);
|
||||||
|
}
|
||||||
|
$uri[0] .= '?' . http_build_query($params);
|
||||||
|
}
|
||||||
|
return home_url( $uri[0] );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup Admin Portal
|
* Setup Admin Portal
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ $scripts = [];
|
|||||||
window.top.location = lawCartaDomain + '/catalog';
|
window.top.location = lawCartaDomain + '/catalog';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<?php if (get_query_var('lctc', false)):?>
|
||||||
|
<link rel="canonical" href="<?= get_canonocal_url()?>">
|
||||||
|
<?php endif; ?>
|
||||||
<!-- ClickDesk Live Chat Service for websites -->
|
<!-- ClickDesk Live Chat Service for websites -->
|
||||||
|
|
||||||
<a href="#" id="livilyChatLink" class="livilyChatButton ClickdeskChatLink" onclick="return false;"></a>
|
<a href="#" id="livilyChatLink" class="livilyChatButton ClickdeskChatLink" onclick="return false;"></a>
|
||||||
|
|||||||
Reference in New Issue
Block a user