handling found-posts at start
This commit is contained in:
parent
75cba963e5
commit
f66d35a776
|
|
@ -4,6 +4,14 @@
|
||||||
<?php
|
<?php
|
||||||
get_header();
|
get_header();
|
||||||
$pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
$pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
||||||
|
|
||||||
|
$initialPosts = new WP_Query([
|
||||||
|
"status" => "publish",
|
||||||
|
"post_type" => "artisans",
|
||||||
|
"posts_per_page" => -1,
|
||||||
|
"paged" => 1,
|
||||||
|
]);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="homegrade-page-container metiers-patrimoine-page-container--repertoire-metiers">
|
<div class="homegrade-page-container metiers-patrimoine-page-container--repertoire-metiers">
|
||||||
|
|
@ -24,7 +32,6 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
||||||
|
|
||||||
<li><a href="<?php echo $frontPageUrl ?>"><?php echo $frontPageTitle ?></a></li>
|
<li><a href="<?php echo $frontPageUrl ?>"><?php echo $frontPageTitle ?></a></li>
|
||||||
|
|
||||||
|
|
||||||
<?php if ($currentPage) : ?>
|
<?php if ($currentPage) : ?>
|
||||||
<li><a href="<?php echo get_post_permalink($currentPage->ID) ?>" aria-current="location" aria-disabled="true"><?php echo $currentPage->post_title ?></a></li>
|
<li><a href="<?php echo get_post_permalink($currentPage->ID) ?>" aria-current="location" aria-disabled="true"><?php echo $currentPage->post_title ?></a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
@ -48,8 +55,7 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
||||||
<aside class="metier-patrimoine-searchbar">
|
<aside class="metier-patrimoine-searchbar">
|
||||||
<div class="metier-patrimoine-searchbar__results-indications">
|
<div class="metier-patrimoine-searchbar__results-indications">
|
||||||
<p class="posts-results-count" role="status" aria-live="polite">
|
<p class="posts-results-count" role="status" aria-live="polite">
|
||||||
<span class="results-count">
|
<span class="results-count"><?php echo $initialPosts->found_posts; ?> </span>
|
||||||
4 </span>
|
|
||||||
<span class="results-text">résultat(s) </span>
|
<span class="results-text">résultat(s) </span>
|
||||||
</p>
|
</p>
|
||||||
<div class="active-research-indicator" is-active="false">
|
<div class="active-research-indicator" is-active="false">
|
||||||
|
|
@ -207,12 +213,6 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
||||||
|
|
||||||
<div class=" artisans-posts__grid">
|
<div class=" artisans-posts__grid">
|
||||||
<?php
|
<?php
|
||||||
$initialPosts = new WP_Query([
|
|
||||||
"status" => "publish",
|
|
||||||
"post_type" => "artisans",
|
|
||||||
"posts_per_page" => -1,
|
|
||||||
"paged" => 1,
|
|
||||||
]);
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($initialPosts->posts as $key => $artisanPost) {
|
foreach ($initialPosts->posts as $key => $artisanPost) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user