fallback when no posts found

This commit is contained in:
Antoine M 2023-11-21 11:16:58 +01:00
parent af0f8dea42
commit 9d9e79749b
4 changed files with 6 additions and 26 deletions

View File

@ -12,7 +12,6 @@ $queryArgs = array(
),
),
);
$pressPosts = new WP_Query($queryArgs);
$args = array(
@ -46,6 +45,9 @@ $newsTemplatePage = get_pages($args) ? get_pages($args)[0] : null;
?>
<?php endforeach; ?>
<?php if ($pressPosts->found_posts === 0) : ?>
<p class="no-posts-found"> <?php echo __("Pas de communiqué de presse actuellement", "homegrade-theme__texte-fonctionnel") ?> </p>
<?php endif; ?>
</div>
<?php if ($pressPosts->max_num_pages > 1) : ?>
<a class="cta cta--outline cta--button mx-auto" href="<?php echo get_permalink($newsTemplatePage) ?>">

View File

@ -1,16 +1,4 @@
/*!***************************************************************************************************************************************************************************************************************************************************!*\
!*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***!
\***************************************************************************************************************************************************************************************************************************************************/
/**
* The following styles get applied both on the front of your site
* and in the editor.
*
* Replace them with your own styles or remove the file completely.
*/
.wp-block-create-block-test {
background-color: #21759b;
color: #fff;
padding: 2px;
}
/*# sourceMappingURL=style-index.css.map*/

View File

@ -12,7 +12,6 @@ $queryArgs = array(
),
),
);
$pressPosts = new WP_Query($queryArgs);
$args = array(
@ -46,6 +45,9 @@ $newsTemplatePage = get_pages($args) ? get_pages($args)[0] : null;
?>
<?php endforeach; ?>
<?php if ($pressPosts->found_posts === 0) : ?>
<p class="no-posts-found"> <?php echo __("Pas de communiqué de presse actuellement", "homegrade-theme__texte-fonctionnel") ?> </p>
<?php endif; ?>
</div>
<?php if ($pressPosts->max_num_pages > 1) : ?>
<a class="cta cta--outline cta--button mx-auto" href="<?php echo get_permalink($newsTemplatePage) ?>">

View File

@ -1,12 +0,0 @@
/**
* The following styles get applied both on the front of your site
* and in the editor.
*
* Replace them with your own styles or remove the file completely.
*/
.wp-block-create-block-test {
background-color: #21759b;
color: #fff;
padding: 2px;
}