FIX cleaning urls problems
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nonimart 2025-07-29 11:54:03 +02:00
parent 9672bf6d04
commit 6713d3d67a

View File

@ -1,6 +1,5 @@
<?php
global $post;
$current_lang = apply_filters('wpml_current_language', null);
$postID = $args['post_ID'];
@ -10,7 +9,8 @@ $postDefautlThumbnail = get_stylesheet_directory_uri() . '/resources/img/illustr
$post_title = $args['post_title'];
$post_permalink = get_the_permalink($postID);
$post_guid = get_the_guid($postID);
$artisans_clean_url = get_home_url(null, '/') . 'artisans/' . $post->post_name;
$company_members = get_field('company_members', $postID);
$currentTaxonomy = $args['current_taxonomy'];
@ -25,13 +25,12 @@ $website = get_field('website', $postID);
$adresse = get_field('adresse', $postID);
$cover_image = get_field('artisan_cover', $postID);
$wpml_fixed_permalink = apply_filters('wpml_permalink', $post_guid, $current_lang);
?>
<article class="card-artisans">
<a href="<?php echo $wpml_fixed_permalink ?>" class="card-artisans__cover-container">
<a href="<?php echo $artisans_clean_url ?>" class="card-artisans__cover-container">
<?php if ($cover_image): ?>
<img src="<?php echo $cover_image['url'] ?>" alt="<?php echo $post_title ?>" class="card-artisans__cover-image">
<?php else: ?>
@ -40,7 +39,7 @@ $wpml_fixed_permalink = apply_filters('wpml_permalink', $post_guid, $current_lan
</a>
<div class="card-artisans__inner">
<a href="<?php echo $wpml_fixed_permalink ?>" class="card-artisans__title-container">
<a href="<?php echo $artisans_clean_url ?>" class="card-artisans__title-container">
<h2 class="card-artisans__title"><?php echo $post_title ?></h2>
</a>
<?php if ($company_members): ?>
@ -76,7 +75,7 @@ $wpml_fixed_permalink = apply_filters('wpml_permalink', $post_guid, $current_lan
<a class="card-artisans__website" href="<?php echo $website ?>" target="_blank"><?php echo $clean_website ?></a>
<?php endif; ?>
<a href=" <?php echo $wpml_fixed_permalink ?>" class="cta cta--read-more cta--with-arrow-button ">
<a href=" <?php echo $artisans_clean_url ?>" class="cta cta--read-more cta--with-arrow-button ">
<span><?php echo __("En savoir plus", 'metiers-patrimoine-theme') ?></span>
<span class="sr-only"> &nbsp;<?php echo $post_title ?></span>
<img class="cta_arrow_button" src='<?php echo get_template_directory_uri() ?>/resources/img/graphic-assets/arrow-right-circle.svg' alt=''>