I created a CPT with ACF where I store the list of user reviews.
In the frontend the load button does its job and everything works correctly, but when the list is empty I think it should disappear, but instead it remains visible.
p.s.This behavior doesn’t happen the first time but only after I populate the CPT and then clear them.
Thank you for your report. I think I may need more context to fully understand your setup. Could you please share temporary admin access to help@bricksbuilder.io with a link to this thread? Thanks
Thank you very much for sharing access. Yeah you’re right there seems to be some inconsistent behavior with when the button is rendered. I have created an internal ticket to address this.
We’ve fixed this issue in Bricks 1.9.4, now available as a one-click update in your WordPress Dashboard.
Changelog: Bricks 1.9.4 Changelog – Bricks
Please let us know if you are still experiencing issues.
I don’t know if it’s related with the bug above, but i had a “Load more” button with interactions for the button to disappear and appear when the AJAX Query started and ended respectively. It used to work fine. With one of the latest updates, once all the products are loaded the “Load more” button is still there (it used to dissapear, as expected). I was able to reproduce this in 2 different websites. Could you take a look into this issue, please? Thank you.
Note: Having only the first interaction on the button works fine, meaning that upon the last query load the button disappears. But the effect of the button hiding and showing is not there of course.
EDIT: Also, in a product category with only a few products the button is appearing (it used to be hidden).
In 1.9.4, we changed the way to hide the Load More button via css class brx-load-more-hidden (Previously was display:none, using CSS class is more flexible for different user customization and easier code maintenance)
Hence, your Interaction that “Show element” (display:block) will overwrite our brx-load-more-hidden style. And that’s why the load more button still showing even if the query reaches max page.
To address this issue, you should remove the Query AJAX loader (End) interaction as Bricks will programatically hide or show the button.
And change the Query AJAX loader (Start) action to “Set Attribute”, Key = “class”, Value = “brx-load-more-hidden” (This way the button will be hidden when AJAX is calling)
@itchycode
Hi! Sorry for the late reply. Your solution works for the most part, with one issue. I mentioned it in the last sentence of my previous post.
Lets say we have set 15 posts per page in the query settings of our archive template but in a specific category there are 15 or fewer results. The button is still visible in that case.
We are aware of that problem, it will be improved soon when native Filter feature delivered.
As a workaround, you can also use Condition on the Load more button.