FEATURE Handling different type display for multiple post types
This commit is contained in:
parent
7d9e53a076
commit
0045513e8e
|
|
@ -19,6 +19,7 @@
|
|||
@apply rounded-full bg-white border-2 border-primary;
|
||||
}
|
||||
&--articles:before,
|
||||
&--activites:before,
|
||||
&--article:before {
|
||||
@apply w-6 bg-carhop-purple-300 -rotate-45;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,14 @@
|
|||
$current_post_id = $args['current_post_id'] ?? get_the_ID();
|
||||
$current_post_type = $args['current_post_type'] ?? null;
|
||||
$type = null;
|
||||
$current_post_type_supports_type = is_object_in_taxonomy($current_post_type, 'type');
|
||||
$current_post_type_supports_type = get_post_type_supports_type($current_post_type);
|
||||
|
||||
$hasNumerotation = hasPostTypeNumerotation($current_post_type);
|
||||
|
||||
if ($current_post_type_supports_type) {
|
||||
$type_term = get_the_terms($current_post_id, 'type')[0] ?? null;
|
||||
// $type = isset($types_terms[0]) ? $types_terms[0] : null;
|
||||
$type_term = get_post_specific_type_terms($current_post_id)[0] ?? null;
|
||||
|
||||
if ($type_term) {
|
||||
$type = $type_term->name;
|
||||
}
|
||||
|
|
@ -17,7 +20,6 @@ if ($current_post_type_supports_type) {
|
|||
}
|
||||
?>
|
||||
|
||||
|
||||
<div class="content-meta">
|
||||
<?php if ($type) : ?>
|
||||
<span class="content-meta__type content-meta__type--<?php echo $current_post_type ?>"><?php echo $type ?></span>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user