FIX optimizing post name query and adress translations
This commit is contained in:
parent
354a3ac83f
commit
b4a741391d
|
|
@ -1,17 +1,18 @@
|
|||
<?php
|
||||
// global $post;
|
||||
$postID = $args['post_ID'];
|
||||
$post = get_post($postID);
|
||||
// global $post;
|
||||
// $post = get_post($postID);
|
||||
// $post_name = $post->post_name;
|
||||
$post_name = get_post_field('post_name', $postID);
|
||||
|
||||
$current_lang = apply_filters('wpml_current_language', null);
|
||||
|
||||
$post_thumbnail = get_the_post_thumbnail($postID, 'full', array('class' => 'card-artisans__thumbnail card-post__thumbnail')) ?? null;
|
||||
$postDefautlThumbnail = get_stylesheet_directory_uri() . '/resources/img/illustrations/Homegrade_resultats-filtres.svg';
|
||||
|
||||
$post_title = $args['post_title'];
|
||||
$post_permalink = get_the_permalink($postID);
|
||||
|
||||
$artisans_clean_url = get_home_url(null, '/') . 'artisans/' . $post->post_name;
|
||||
$artisans_clean_url = get_home_url(null, '/') . 'artisans/' . $post_name;
|
||||
|
||||
$company_members = get_field('company_members', $postID);
|
||||
$currentTaxonomy = $args['current_taxonomy'];
|
||||
|
|
@ -28,7 +29,7 @@ $email = get_field('email', $postID);
|
|||
$website = get_field('website', $postID);
|
||||
|
||||
$adresse = get_field('adresse', $postID);
|
||||
$translated_city = translate_city_name($adresse['city'], $current_lang);
|
||||
$translated_city = isset($adresse['city']) ? translate_city_name($adresse['city'], $current_lang) : '';
|
||||
$cover_image = get_field('artisan_cover', $postID);
|
||||
|
||||
|
||||
|
|
@ -66,7 +67,7 @@ $cover_image = get_field('artisan_cover', $postID);
|
|||
<?php if ($adresse): ?>
|
||||
|
||||
<p class="card-artisans__adresse">
|
||||
<?= ($adresse['post_code'] ?? '') . ' ' . ($adresse['city'] ?? '') ?>
|
||||
<?= ($adresse['post_code'] ?? '') . ' ' . ($translated_city) ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user