{{-- Title: Content-text Description: WYSIWYG for the post & page Category: formatting Icon: columns Keywords: text Mode: edit Align: left PostTypes: page post SupportsAlign: full SupportsMode: true SupportsMultiple: true EnqueueStyle: EnqueueScript: EnqueueAssets: --}} @php $content = get_field('content'); $hasDropCap = get_field('has_drop_cap'); $hasRelatedPost = get_field('has_related_post'); $category = get_the_category(); $postID = get_the_id(); $chooseCategory = get_field('cat_priority', $postID); // error_log(json_encode($chooseCategory)); $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; //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); @endphp