@php $postID = get_the_id(); $postSlug = get_slug_by_id($postID); $thumbnailID = get_post_thumbnail_id(); $title = get_the_title(); $excerpt = get_the_excerpt(); $date = get_the_date('d.m.y'); $link = get_the_permalink(); $chooseCategory = get_field('cat_priority', $postID); // error_log(json_encode($chooseCategory)); $category = get_the_category(); $finalCategory = $category[0]; if (!is_null($chooseCategory) && $chooseCategory !== 'no') { foreach ($category as $cat) { // error_log(json_encode($cat->slug)); if (strpos($chooseCategory, $cat->slug) !== false){ $finalCategory = $cat; break; } } } $category_name = $finalCategory->slug; $category_name_tile = $finalCategory->cat_name; // error_log(json_encode($finalCategory)); // error_log(json_encode($colorCategory)); $categoryEnID = apply_filters( 'wpml_object_id', $finalCategory->term_id, 'category', true, 'en-gb'); do_action('disable_wpml_auto_id'); $enCategory = get_category($categoryEnID); do_action('enable_wpml_auto_id'); //PEOPLE $peopleOrId = get_category_by_slug('people') -> term_id; $peopleId = apply_filters( 'wpml_object_id', $peopleOrId, 'category', true ); $peopleCategory = get_category($peopleId); //PLANET $planetOrId = get_category_by_slug('planet') -> term_id; $planetId = apply_filters( 'wpml_object_id', $planetOrId, 'category', true ); $planetCategory = get_category($planetId); //CHIME $chimeOrId = get_category_by_slug('chime') -> term_id; $chimeId = apply_filters( 'wpml_object_id', $chimeOrId, 'category', true ); $chimeCategory = get_category($chimeId); $img = get_the_post_thumbnail_url(); $altText = get_post_meta($thumbnailID, '_wp_attachment_image_alt', true ); $bodyClassModifier = $bodyClassModifier ?? ''; // string applied as css-class $dataLayerLabel = $dataLayerLabel ?? ''; // string applied as css-class // TRACKING $engPostID = apply_filters( 'wpml_object_id', $postID, 'post', true, 'en-gb' ); $engTitle = get_the_title($engPostID); // BOOLEAN CHIME POST // $is_chime = get_field('is_a_chime_post', $postID); @endphp