Nothing to show message in the archives despite of {{dc:looper:count}} is 0

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).

:wrench: Setup Overview:

  • Post Type : exercise_gallery
  • Custom Taxonomies :
    • body_part (e.g., chest, legs)
    • stage (e.g., stage-1, stage-2)

:white_check_mark: Sections I’ve Built:

I’ve created 3 separate content sections inside the Archive Layout:

  1. Section 1 — Displays all exercises when no filters are selected.
    Condition: {{dc:url:param key="body_part" fallback=""}} is ""
  2. Section 2 — Filters by body_part only.
    Condition: {{dc:url:param key="body_part" fallback=""}} is not "" AND stage is ""
  3. Section 3 — Filters by both body_part AND stage .
    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.

:warning: 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.

:bulb: 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:

  1. Created a new section with a simple fallback message.
  2. No Looper Provider on this fallback section.
  3. Set the condition to:
{{dc:looper:count}} is 0  
  1. Also tried:
{{dc:looper:count index="1"}} is  0  
  1. 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.

:question: 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! :pray:

Hello @cezarzw,

Thank you for the inquiry.

Did you check if the dc:looper:count is used within the Looper Provider or Looper Consumer? If you can provide the page where you’re testing this, we’ll try to check it further. You can include the site URL and login info in the secure note.

Best regards.

Hey thanks, I’m attaching the secure note to this message, I’ve tried placing the dc:looper:count in a few different ways, right now its sitting at the top of the page in the condition of the section with the "Looks like there are no exercises for this selection —

Thank you for the info. We tried logging in the but we get redirected to a mod security page with this notice.

weird I’ve just tried logging in using those exact creditantials inside of an incognito browser and got straight in, ill re upload the login details again in a secure note

We are still being redirected to the same page with the same notice. You may need to contact your hosting provider about this and possibly ask them to temporarily disable ModSecurity.

Hi thanks for the patience, I spoke to the host, it all seems to be working now, could you please try again using the same credentials.

Hello @cezarzw,

I was able to log in to your site and this is my observation.
1.) You are using the same taxonomy name as the parameter name
2.) When the URL is encoded, WordPress treats the URL as a query variable
3.) I can see that you only have 1 Triceps entry and this is also with Stage 1 taxonomy.
4.) There are no entries for Stage 3
5.) It seems that you are using the AND relationship in your Looper Provider Query String

Based on this information, when you have https://example.com/exercise-gallery/?body_part=triceps&stage=stage-3, WordPress treats the URL as a WordPress Query. Since there are no entries with Triceps AND Stage 3, WordPress automacally returns an Error 404 page which is already a single page.

My recommendations so that your filters will work is this:

  • Change the URL parameter from body_part to bp
  • Change the URL parameter from stage to st

which will then gives you a URL like https://example.com/exercise-gallery/?bp=triceps&st=stage-3. WordPress will not do anything about this but to just refresh the archive page. Then this is the time that the Conditions in your arcgive layout will be rendered.

Hope this makes sense.

Hi there,

Thanks so much for your previous help — your recommendation to change the URL parameters (from body_part to bp and stage to st ) worked perfectly in preventing the 404 issue. That solved a major roadblock in our filtering setup!

I do have a follow-up question related to filtering with taxonomies:

As we continue building this archive, we’re aiming to allow users to combine filters from multiple taxonomies (e.g., selecting a body part and a stage together). While we’ve managed to get basic filtering working with custom JavaScript and dynamic content queries, things get more complex when trying to support multi-stage filtering (e.g., Stage 1 and/or Stage 2), or when needing filters to work independently yet remain persistent during browsing.

With that in mind:

  • Does Themeco recommend a particular best practice when dealing with multiple taxonomy filters?
  • Or are there any third-party plugins you’d recommend that work well alongside Pro/Cornerstone and ACF for building more advanced filterable archives?

Any insight or tools that streamline filtering — especially for archives relying heavily on ACF taxonomies — would be hugely appreciated.

Thanks again for your time and continued support!

Best regards,
Cezar

Hello Cezar,

You might want to check out the FacetWP plugin. Some users are using it with the theme.

When dealing with multiple filters, you will have to decide whether to use AND or OR relatioship with the taxonomies. Most of the time, the AND relationship may give out error 404 or that it will return nothing.

Hope this helps.

Thanks so much for the clarification around filtering and the recommendation of FacetWP — I’ll definitely keep that in mind for future projects. Unfortunately for this build, I’m using the MemberPress plugin and heard that the two can conflict, so I’m sticking with a custom filtering setup for now.

Based on your suggestion, I’ve updated the filtering system to use dynamic content and query parameters ( bp for body parts and st for stage), and we’ve now fully transitioned to using the Query Builder with custom JSON for all content sections.

We’re using posts_per_page and paged in the JSON, and pagination visually appears and correctly updates the URLs across pages. I’ve also scoped each pagination element to its relevant section and applied this conditional:

{{dc:looper:total_pages}} > 1

Each section only displays when appropriate filters are active — and the pagination element is wrapped in the same logic.

The issue:

Despite this, pagination still shows up even when:

  • There’s only one post (so no need for pagination),
  • Or when no posts are found at all.

We’ve confirmed that:

  • Each looper is separate,
  • The conditional is applied,
  • And we’re only using the Query Builder and JSON (no string queries).

Do you have any tips or best practices to ensure the pagination only shows when there’s actually more than one page of results , especially in custom archive layouts using the Query Builder?

Thanks again for all your support :pray:

Cezar

Looks like the Row element containing the pagination is outside the element with the Looper Provider. The dynamic template {{dc:looper:total_pages}} will return the default query if this is the case. Make sure the pagination or the element with the condition {{dc:looper:total_pages}} > 1 is inside the Provider > Consumer – set the Count to one to avoid duplicating the pagination.

That makes a lot of sense, I changed the Looper Provider from the row to the section and now its all working as intended. Thanks a lot for the support

You are most welcome, Cezar.
Glad to be able to help you out.