Hey guys.
I’m building an archive-style filtering setup inside the Cornerstone Archive Builder using Themeco Pro , and I’ve run into a bit of a block when trying to show a fallback message when no results are found (instead of getting the default “Nothing to show right now” page).
Setup Overview:
-
Post Type :
exercise_gallery
-
Custom Taxonomies :
-
body_part
(e.g., chest, legs) -
stage
(e.g., stage-1, stage-2)
-
Sections I’ve Built:
I’ve created 3 separate content sections inside the Archive Layout:
-
Section 1 — Displays all exercises when no filters are selected.
Condition: {{dc:url:param key="body_part" fallback=""}} is ""
-
Section 2 — Filters by
body_part
only.
Condition: {{dc:url:param key="body_part" fallback=""}} is not "" AND stage is ""
-
Section 3 — Filters by both
body_part
ANDstage
.
Condition: {{dc:url:param key="body_part" fallback=""}} is not "" AND stage is not ""
(This one uses a dynamic string query to filter results based on both taxonomies.)
Each section has its own Looper Provider querying exercise_gallery
posts using tax_query via string query.
The Problem:
When someone filters the gallery with a combination like:
/exercise-gallery/?body_part=triceps&stage=stage-3
…and no results exist , WordPress renders the default “Nothing to Show Right Now” fallback page — and none of my custom layout appears. So I lose control over the design completely.
What I Tried:
To prevent this, I added a 4th section that should only appear when no results are found . Here’s what I did:
- Created a new section with a simple fallback message.
- No Looper Provider on this fallback section.
- Set the condition to:
{{dc:looper:count}} is 0
- Also tried:
{{dc:looper:count index="1"}} is 0
- I also added a hidden looper section with the same query string as Section 3, just to ensure something is counted — but it doesn’t seem to trigger.
What I Need Help With:
- Why isn’t
dc:looper:count
working as expected to detect 0 results? - Is there a Themeco-recommended way to override the default “Nothing to show” fallback and replace it with my own section when no posts match the query?
Would love your guidance on this — everything else about the archive works beautifully, but I’d love to fix this one last piece.
Thanks in advance!