From 9d9e79749b501f44616f231b8c2865412eeb4c83 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 21 Nov 2023 11:16:58 +0100 Subject: [PATCH] fallback when no posts found --- blocks/communiques-presse-feed/build/render.php | 4 +++- blocks/communiques-presse-feed/build/style-index.css | 12 ------------ blocks/communiques-presse-feed/src/render.php | 4 +++- blocks/communiques-presse-feed/src/style.scss | 12 ------------ 4 files changed, 6 insertions(+), 26 deletions(-) diff --git a/blocks/communiques-presse-feed/build/render.php b/blocks/communiques-presse-feed/build/render.php index 48146f0..25079cf 100644 --- a/blocks/communiques-presse-feed/build/render.php +++ b/blocks/communiques-presse-feed/build/render.php @@ -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; ?> + found_posts === 0) : ?> +

+ max_num_pages > 1) : ?> diff --git a/blocks/communiques-presse-feed/build/style-index.css b/blocks/communiques-presse-feed/build/style-index.css index a928900..a6cfed5 100644 --- a/blocks/communiques-presse-feed/build/style-index.css +++ b/blocks/communiques-presse-feed/build/style-index.css @@ -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*/ \ No newline at end of file diff --git a/blocks/communiques-presse-feed/src/render.php b/blocks/communiques-presse-feed/src/render.php index 48146f0..25079cf 100644 --- a/blocks/communiques-presse-feed/src/render.php +++ b/blocks/communiques-presse-feed/src/render.php @@ -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; ?> + found_posts === 0) : ?> +

+ max_num_pages > 1) : ?>
diff --git a/blocks/communiques-presse-feed/src/style.scss b/blocks/communiques-presse-feed/src/style.scss index def8e91..e69de29 100644 --- a/blocks/communiques-presse-feed/src/style.scss +++ b/blocks/communiques-presse-feed/src/style.scss @@ -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; -}