NO BUG: WAIT: Load More Interaction for Query Loop Broken if more than 1 Exists

I am using Bricks v1.7.

I have an archive template for a Custom Post Type with a grid which has a card that has a query loop.

I added a button and set the interaction for the button:

Trigger: Click
Action: Load More (Query loop)
Query: My-Query-Name

This worked fine. The loop loads 6 items and the Load More button displays. When clicked it will continue to load 6 items until there are no items left.

This CPT has a category taxonomy. For this Category Archive Template I built it the same way. Unfortunately it does not work.

When I view the front end the page loads fine and the grid has the first 6 items but the “Load More” button displays briefly but then disappears. In fact all buttons on the page display briefly and then disappear.

While this grid with the load more button doesn’t work the other CPT Archive Template grid still works fine.

I then added a Load More button to my search results template and it works fine.

I then went back and tried the CPT Archive Template and it is now broken and doing the same thing as the Category Archive Template. The Load More button displays briefly and then disappears along with all the other buttons on the page.

So what is happening?

One thing to note is that the grids and cards for all 3 templates have the same layout and classes. The only real difference is the Query Loop and the ids of the elements.

I also notice that when I added the button to the Search Template that it magically had the Interaction I wanted already applied. This leads me to believe that Bricks is having issues determining what interaction belongs to what button on the website.

Things appear to be screwed up more than I initially thought.

On all pages any Bricks buttons disappear on page load. Checking in the Bricks Builder none have interactions applied.

When I check the page source this is what I fine on the buttons

data-interactions="[{"id":"mihqks","trigger":"click","action":"loadMore","loadMoreQuery":"toefom"}]" data-interaction-id="557265"

The only thing that is different for each button in the source is the data-interaction-id

After further investigation and searching the database I ended up finding the id “mihqks” in the

Table: WP_Options
Option_name
bricks_global_classes

It’s a large row but I think this is the entire record from the serialized data:

i:1160;a:3:{s:2:"id";s:23:"acss_import_btn--action";s:4:"name";s:11:"btn--action";s:8:"settings";a:1:{s:13:"_interactions";a:1:{i:0;a:4:{s:2:"id";s:6:"mihqks";s:7:"trigger";s:5:"click";s:6:"action";s:8:"loadMore";s:13:"loadMoreQuery";s:6:"toefom";}}}}

From looking at it I saw the mention of “btn–action” which is a class I use on most of my buttons (from ACSS).

So I looked at the class in the Bricks Builder (by looking at one of my buttons) and saw that there is an a load more interaction tied to the class. I didn’t realize this could be done. So I am not sure if this was a mistake on my part (ie I had the class selected as well as the element when adding one of the interactions) or if this was a Bricks Builder Saving issue…

Anyways I deleted the interaction which fixed all my buttons disappearing. :grinning:

I then went through and re-added the 3 load more interactions to the buttons and almost everything is working again!

The search and CPT archive load more button is working but the Category archive template one is not. It does not display the button at all when it should. The query is setup to pull just the posts from my CPT. Nothing else is set except posts per page in the query (which is set to 3). I assume that the template itself is restricting the query to return only CPTs that belong to the category being viewed. Could this be causing the problem with the Load More Button? (as the query’s are merged???)

Hey Tom,
I’m glad you were able to solve the button problem by yourself :slight_smile:

It is difficult to say something about the category archive template from the gut, I would have to take a look. Can you send me access data and the link to the corresponding template?

Thanks.

Just sent the details to help@bricksbuilder.io

Let me know how it goes.

From whatever plugin this setting may come: it is the reason that the button is not displayed :wink:

… sorry another mistake… With all the other problems I was having I assumed it was somewhat related.

No problem, happens to the best :slight_smile: