conditionnal no-found post-components if no post found
This commit is contained in:
parent
8dc45e970e
commit
db9d6671d8
|
|
@ -30,7 +30,6 @@ function build_search_artisan_posts_cards($request)
|
||||||
$StringifiedTaxonomyIds = esc_html($request->get_param('taxonomy-ids')) ?? null;
|
$StringifiedTaxonomyIds = esc_html($request->get_param('taxonomy-ids')) ?? null;
|
||||||
|
|
||||||
do_action('wpml_switch_language', $currentLanguage);
|
do_action('wpml_switch_language', $currentLanguage);
|
||||||
$test = __("Aucun résultat trouvé", "metiers-patrimoine-theme");
|
|
||||||
$lang = apply_filters('wpml_current_language', null);
|
$lang = apply_filters('wpml_current_language', null);
|
||||||
$taxonomyIds = explode(',', $StringifiedTaxonomyIds);
|
$taxonomyIds = explode(',', $StringifiedTaxonomyIds);
|
||||||
$taxonomyIds = array_map('intval', $taxonomyIds);
|
$taxonomyIds = array_map('intval', $taxonomyIds);
|
||||||
|
|
@ -94,6 +93,8 @@ function build_search_artisan_posts_cards($request)
|
||||||
|
|
||||||
$html_template = ob_get_clean();
|
$html_template = ob_get_clean();
|
||||||
|
|
||||||
|
|
||||||
|
if ($newsPostsDatas->found_posts === 0) {
|
||||||
ob_start();
|
ob_start();
|
||||||
get_template_part(
|
get_template_part(
|
||||||
'template-components/artisans/artisan-search-no-results',
|
'template-components/artisans/artisan-search-no-results',
|
||||||
|
|
@ -101,8 +102,6 @@ function build_search_artisan_posts_cards($request)
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
$html_template = ob_get_clean();
|
$html_template = ob_get_clean();
|
||||||
|
|
||||||
if ($newsPostsDatas->found_posts === 0) {
|
|
||||||
}
|
}
|
||||||
$response_data = array(
|
$response_data = array(
|
||||||
'html_template' => $html_template,
|
'html_template' => $html_template,
|
||||||
|
|
@ -147,7 +146,6 @@ function debugQueryTest()
|
||||||
);
|
);
|
||||||
$html_template = ob_get_clean();
|
$html_template = ob_get_clean();
|
||||||
$test = __("Aucun résultat trouvé", "metiers-patrimoine-theme");
|
$test = __("Aucun résultat trouvé", "metiers-patrimoine-theme");
|
||||||
// write_log($test);
|
|
||||||
return ($html_template);
|
return ($html_template);
|
||||||
}
|
}
|
||||||
// debugQueryTest();
|
// debugQueryTest();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user