Hi,
I’m working on a project with the following setup: Normal posts can be connected to a specific team (CPT) via ACF relationships. For the team pages, I’ve created a template that displays ACF values and also the associated blog posts. To only output the relevant posts on a team page, I’ve used a meta query and the {post_id} (see screenshot below).
In addition to that, I wanted to limit the number of posts and then give the user the option to load more posts by clicking on a button. I’ve set this up as usual, using the load more interaction. But unfortunately, it is not working as expected.
While trying to solve the problem, I’ve tested the following things:
Removed the meta query in the template: the load more interaction works fine.
Added a meta query to a loop on a normal page using a specific ID like “1140”: the load more interaction also works fine.
So, I think the issue comes from using the {post_id} in a meta query in a post template.
Could you take a look at this issue? I can also send you login credentials if necessary.
Would you be so kind as to send temporary login credentials and a link to this thread to help@bricksbuilder.iousing the email address you used during the purchase?
This makes it a little easier to understand your setup and find the cause of the problem
The quotation marks within the meta value are not necessary and ensure that the query does not work. Without them, it works perfectly, as far as I can see.
Ou! Thank you! I read somewhere that the quotation marks are needed. Sorry for not testing that.
The only thing I notice now, is that when I load more posts, they are not posts associated with the team. (womens teams on the men’s team page) Also some posts are shown twice.
Hey, you are using {post_id} as the meta value, which returns the ID of the post within the loop - not the id of the team post in which the loop is located and to which the ACF relationship refers. Instead, you should use {echo:get_queried_object_id()} as the meta value, which returns the post id of the actual team post.
However, there is a problem with the load more, as the meta value is always set to 0 in this case. I have added the problem to the bug tracker.
I have added a basic text element with the corresponding dd tags so that I can see what is happening, which you are welcome to delete.
Hi Stefan,
Thank you very much for resolving the issue in the newest update!
I’ve just tested it, and it appears to be working well so far. The only issue I’ve noticed is that the button remains visible even when there are no additional posts to load.
Is there a way to hide the button with conditions?
Thank you very much for your work!
Kind regards,
Simone
Hi Stefan,
Sorry I’ve deleted the account too early. I’ve created new credentials and sent it to you.
Thank you for resolving the problem!
Kind regards,
Simone