/** * Shortcode: [verizon_warp_metrics_cards] * Output two metric cards (Verizon & Warp) whose markup / behaviour matches the * T‑Mobile / US Mobile cards. Requires the companion CSS file. */ function render_verizon_warp_metrics_cards( $atts = [] ) { // ——————————————————————— // Custom‑field helpers…Continue reading
function render_tmobile_lightspeed_metrics_cards($atts) { // Fetch custom fields $custom_fields = get_post_meta(get_the_ID()); // City/state $city = !empty($custom_fields[‘city’][0]) ? $custom_fields[‘city’][0] : ‘Unknown City’; $state = !empty($custom_fields[‘state’][0]) ? $custom_fields[‘state’][0] : ‘Unknown State’; // Helper functions if (!function_exists(‘get_field_value’)) { function get_field_value($fields, $key, $default = 0)…Continue reading
function tmobile_coverage_map_shortcode() { // Get current post ID and required custom fields $post_id = get_the_ID(); $zip_code = get_post_meta($post_id, ‘zip_code’, true); $city = get_post_meta($post_id, ‘city’, true); $state = get_post_meta($post_id, ‘state’, true); // If required fields are missing if (empty($zip_code) || empty($city)…Continue reading
// Shortcode to display Zip Code Coverage Map with Optimized GeoJSON Loading function zip_code_coverage_map_shortcode() { ob_start(); ?>Continue reading
function render_att_darkstar_metrics_cards($atts) { // Fetch custom fields $custom_fields = get_post_meta(get_the_ID()); $city = isset($custom_fields[‘city’][0]) ? $custom_fields[‘city’][0] : ‘Unknown City’; $zip_code = isset($custom_fields[‘zip_code’][0]) ? $custom_fields[‘zip_code’][0] : ‘00000’; // Helper function to safely get field values if (!function_exists(‘get_field_value’)) { function get_field_value($fields, $key, $default…Continue reading
// Shortcode to display Zip Code Coverage Map with Optimized GeoJSON Loading (Lazy-Loaded) function att_coverage_map_shortcode() { // Retrieve current post ID and its custom ‘zip_code’ $post_id = get_the_ID(); $zip_code = get_post_meta($post_id, ‘zip_code’, true); $avg_dl = get_post_meta($post_id, ‘att_mean_download_kbps’, true); $avg_dl_formatted =…Continue reading
// Shortcode to display Zip Code Coverage Map with Optimized GeoJSON Loading (Lazy-Loaded) function verizon_coverage_map_shortcode() { // Retrieve current post ID and its custom ‘zip_code’ $post_id = get_the_ID(); $zip_code = get_post_meta($post_id, ‘zip_code’, true); $avg_dl = get_post_meta($post_id, ‘verizon_mean_download_kbps’, true); $avg_dl_formatted =…Continue reading
function generate_map_of_nearby_stores() { // Get current post ID $post_id = get_the_ID(); // Retrieve the zip code, city, and state from custom fields $zip_code = get_post_meta($post_id, ‘zip_code’, true); $city = get_post_meta($post_id, ‘city’, true); $state = get_post_meta($post_id, ‘state’, true); // If required…Continue reading
function set_usm_utm_cookie() { if (!isset($_COOKIE[‘utm_params’])) { $current_path = $_SERVER[‘REQUEST_URI’]; $path_parts = explode(‘?’, $current_path, 2); $current_path = $path_parts[0]; $utm_params_value = “utm_source=us_mobile&utm_medium=organic&utm_campaign=” . urlencode($current_path); // Set a cookie with URL-encoded path for 1 year setcookie(‘utm_params’, $utm_params_value, time() + (365 * 24 *…Continue reading
function enqueue_jquery() { if (!wp_script_is(‘jquery’, ‘enqueued’)) { wp_enqueue_script(‘jquery’); } } add_action(‘wp_enqueue_scripts’, ‘enqueue_jquery’);Continue reading