# WAIT: Query Loop issue

**URL:** <https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777>\
**Category:** Bugs\
**Tags:** v1-10-3\
**Created:** [October 4, 2024, 7:06am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777 "2024-10-04T07:06:17Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![thehedgedog](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/thehedgedog/32/21988_2.png) [@thehedgedog](https://forum.bricksbuilder.io/u/thehedgedog)\
**Post date:** [October 4, 2024, 7:06am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/1 "2024-10-04T07:06:17Z")

</div>

I’m working with a custom post type displayed within a query loop, which includes a shortcode that outputs content from another plugin. However, I’m encountering issues with both infinite scroll and pagination:

1. When using infinite scroll, the shortcode content doesn’t load as expected.
2. Pagination doesn’t work at all, and it seems to have a serious bug that requires fixing.

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [October 4, 2024, 7:43am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/2 "2024-10-04T07:43:48Z")

</div>

Hi @thehedgedog,

I’ve tested the shortcode (that only outputs “Hello World”), and the output was working nicely, even when using infinite scroll. Note that if your shortcode outputs a `<script>` tag, that script will not execute: [Element: innerHTML property - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML#security_considerations)

For a second (pagination) problem, I can’t reproduce the bug, but I would love to. Can you give me a bit more info, on what is your setup of the custom query and pagination element?

Thanks,  
Matej

---

<div class="post-metadata">

**Author:** ![thehedgedog](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/thehedgedog/32/21988_2.png) [@thehedgedog](https://forum.bricksbuilder.io/u/thehedgedog)\
**Post date:** [October 4, 2024, 7:55am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/3 "2024-10-04T07:55:36Z")

</div>

The shortcode I’m using is in a meta box which I created with JetEngine, as each post has unique content generated by different shortcodes. This content is provided by the Sonnar MP3 Player plugin, which I’m primarily using for audio waveform generation.

so the shortcode is basically a dynamic content on each post

the shortcode widget content in the query looks like this

{je\_presets\_short\_code} \<—which I fetch data from a custom meta box of each post

The issue with pagination is that, when I click to navigate to a different page, the content doesn’t update—it remains stuck on the first page. The content doesn’t change at all.

---

<div class="post-metadata">

**Author:** ![thehedgedog](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/thehedgedog/32/21988_2.png) [@thehedgedog](https://forum.bricksbuilder.io/u/thehedgedog)\
**Post date:** [October 4, 2024, 7:57am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/4 "2024-10-04T07:57:56Z")

</div>

The shortcode works fine with JetEngine listing grid, but Jet Engine doesn’t have the function I need, like sorting with meta key and taxonomy

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [October 4, 2024, 8:13am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/5 "2024-10-04T08:13:33Z")

</div>

> [@thehedgedog](#):
>
> the shortcode widget content in the query looks like this {je\_presets\_short\_code}

This seems like a dynamic tag, not a shortcode. Locally I’ve tested with “Shortcode” element like this :  
 ![slika](https://forum.bricksbuilder.io/uploads/default/original/3X/d/f/df0ef9b641264b8adff77324dba29d5c8e255f08.png)

For pagination and all this, do you have URL that you can share - so I can check what is happening?

Thanks.

---

<div class="post-metadata">

**Author:** ![thehedgedog](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/thehedgedog/32/21988_2.png) [@thehedgedog](https://forum.bricksbuilder.io/u/thehedgedog)\
**Post date:** [October 4, 2024, 8:16am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/6 "2024-10-04T08:16:25Z")

</div>

yes, that is a dynamic tag which fetches a shortcode from a custom meta box in each post

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [October 4, 2024, 8:27am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/7 "2024-10-04T08:27:16Z")

</div>

So, that dynamic tag returns a shortcode. I’ve updated my example in local install, and it works:

 ![slika](https://forum.bricksbuilder.io/uploads/default/original/3X/c/f/cf1c16bee9098ac88589236968ecf148451d3469.png)

Note that the demo shortcode code looks like this:

 ![slika](https://forum.bricksbuilder.io/uploads/default/original/3X/5/1/5111f87740c71692297e982a0cd4ca1833e520bc.png)

---

<div class="post-metadata">

**Author:** ![muzKore](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/muzkore/32/22315_2.png) [@muzKore](https://forum.bricksbuilder.io/u/muzKore)\
**Post date:** [October 4, 2024, 9:07am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/9 "2024-10-04T09:07:25Z")

</div>

Have you considered sending the post id with the shortcode so that it can propoerly identoify the code the post data?

```auto
[my_shortcode id="{{post.id}}"]

```

Then you can add the id into the shortcode function so to make sure the proper record is being accessed.

---

<div class="post-metadata">

**Author:** ![muzKore](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/muzkore/32/22315_2.png) [@muzKore](https://forum.bricksbuilder.io/u/muzKore)\
**Post date:** [October 4, 2024, 9:25am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/11 "2024-10-04T09:25:54Z")

</div>

should  
albums=“6824

be

albums=“6824"

That is one awesome shortcode!!!

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [October 7, 2024, 11:24am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/14 "2024-10-07T11:24:42Z")

</div>

@thehedgedog,

so, have you figured it out, or it’s still not working? I see that you removed last few messages, and I’m wondering if I should set to to no bug 🙂

Best regards,  
Matej

---

<div class="post-metadata">

**Author:** ![thehedgedog](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/thehedgedog/32/21988_2.png) [@thehedgedog](https://forum.bricksbuilder.io/u/thehedgedog)\
**Post date:** [October 7, 2024, 11:35am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/15 "2024-10-07T11:35:09Z")

</div>

No, query loop pagination is not working in the custom post type (I mean if the query loop is in a custom post type page) this needs to be resolved, the third-party plugin is not the primary problem right now.

I just removed some of the messages containing my website URL.

---

<div class="post-metadata">

**Author:** ![thehedgedog](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/thehedgedog/32/21988_2.png) [@thehedgedog](https://forum.bricksbuilder.io/u/thehedgedog)\
**Post date:** [October 7, 2024, 11:38am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/16 "2024-10-07T11:38:13Z")

</div>

Pagination only works on a normal page

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [October 7, 2024, 12:53pm UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/17 "2024-10-07T12:53:07Z")

</div>

@thehedgedog, would it be possible for you to send temporary login credentials to your website and a link to this thread to [help@bricksbuilder.io](mailto:help@bricksbuilder.io) using the email address you used during the purchase, so we can take a look at this pagination problem?

That would help solving the issue 🙂  
Thanks.

---

<div class="post-metadata">

**Author:** ![thehedgedog](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/thehedgedog/32/21988_2.png) [@thehedgedog](https://forum.bricksbuilder.io/u/thehedgedog)\
**Post date:** [October 7, 2024, 5:43pm UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/18 "2024-10-07T17:43:33Z")

</div>

I think I found the problem.

When you change the Permalink Settings in WordPress to “Post Name”

 ![Screenshot 2024-10-08 013615](https://forum.bricksbuilder.io/uploads/default/original/3X/c/8/c86385e8fe1231878453d6d13b9024d8bb428c80.png)

the query loop inside the CPT will not work properly.

I’ve asked my client to set up a staging environment for me, and the email should be on its way.

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [October 8, 2024, 7:03am UTC](https://forum.bricksbuilder.io/t/wait-query-loop-issue/26777/19 "2024-10-08T07:03:26Z")

</div>

I always use “Post Name” for a permalink, so it’s most likely not that. Will wait for an email, thanks!

–  
Matej
