<?php
/**
* The site's entry point.
*
* Loads the relevant template part,
* the loop is executed (when needed) by the relevant template part.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
get_header();
$is_elementor_theme_exist = function_exists( 'elementor_theme_do_location' );
if ( is_singular() ) {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'single' ) ) {
get_template_part( 'template-parts/single' );
}
} elseif ( is_archive() || is_home() ) {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'archive' ) ) {
get_template_part( 'template-parts/archive' );
}
} elseif ( is_search() ) {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'archive' ) ) {
get_template_part( 'template-parts/search' );
}
} else {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'single' ) ) {
get_template_part( 'template-parts/404' );
}
}
get_footer();
<script>
const queryString = window.location.search; //
// Further parsing:
const params = new URLSearchParams(queryString);
const utm_source = params.get("utm_source");
const utm_medium = params.get("utm_medium");
const utm_campaign = params.get("utm_campaign");
const utm_content = params.get("utm_content");
console.log(utm_author)
const anchors = document.getElementsByTagName('a');
for (const anchor of anchors) {
const p = new URLSearchParams(anchor.search);
p.append('utm_source',utm_source);
p.append('utm_medium',utm_medium);
p.append('utm_campaign',utm_campaign);
p.append('utm_content',utm_content);
console.log(p.toString())
}
</script>