UPDATE Update post tag links to use the current post type dynamically
This commit is contained in:
parent
5de6e18115
commit
c949c7bfbe
|
|
@ -2,6 +2,8 @@
|
||||||
$postID = get_the_ID();
|
$postID = get_the_ID();
|
||||||
$etiquettes = get_the_terms($postID, 'etiquettes');
|
$etiquettes = get_the_terms($postID, 'etiquettes');
|
||||||
|
|
||||||
|
$current_post_type = get_post_type($postID);
|
||||||
|
|
||||||
if (empty($etiquettes)) return;
|
if (empty($etiquettes)) return;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
@ -11,7 +13,7 @@ if (empty($etiquettes)) return;
|
||||||
<ul class="tags-list">
|
<ul class="tags-list">
|
||||||
<?php foreach ($etiquettes as $etiquette) : ?>
|
<?php foreach ($etiquettes as $etiquette) : ?>
|
||||||
<li class="post-tag">
|
<li class="post-tag">
|
||||||
<a href="<?php echo add_query_arg('etiquette', $etiquette->slug, get_post_type_archive_link('analyses-etudes')); ?>"><?php echo $etiquette->name; ?></a>
|
<a href="<?php echo add_query_arg('etiquette', $etiquette->slug, get_post_type_archive_link($current_post_type)); ?>"><?php echo $etiquette->name; ?></a>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user