diff --git a/template-parts/components/cards/post-card.php b/template-parts/components/cards/post-card.php index 86d1330..1334abc 100644 --- a/template-parts/components/cards/post-card.php +++ b/template-parts/components/cards/post-card.php @@ -6,8 +6,14 @@ $showExcerpt = $args['show_excerpt'] ?? false; $showTags = $args['showTags'] ?? true; +$has_external_link = $args['has_external_link'] ?? false; +$external_link = $args['external_link'] ?? null; +$external_link_text = $args['external_link_text'] ?? null; + +$target = $has_external_link && ! empty($external_link) ? '_blank' : '_self'; + $excerpt = get_the_excerpt($ID); -$link = get_the_permalink($ID); +$link = ($has_external_link && ! empty($external_link)) ? $external_link : get_the_permalink($ID); $has_post_thumbnail = has_post_thumbnail($ID); $thumbnail_url = get_the_post_thumbnail_url($ID) ?? null; @@ -23,14 +29,12 @@ $editors = get_field('editors', $ID); $has_publication_direction = get_field('has_publication_direction', $ID); $publication_directors = get_field('publication_directors', $ID); - $numerotation = get_post_meta($ID, 'post_numerotation', true); $tags = get_the_terms($ID, 'etiquettes'); - ?> - +
<?php echo $title; ?>