Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Query loop inbclude posts question

  • I’ve had a client say that they’re having trouble with the Query Loop block. It’s a news site, they have a CPT for projects, and each project CP has some intro text and a Query Loop grid of related posts for that project. The posts are selected via Include Posts in the Query Loop settings.

    For most projects there are less than 10 posts, all good.

    For some projects they have as many as 28 posts. These project posts are updated over time, with more posts being added to the Query Loop for any given project.

    When editing those larger projects (with more than 10 related posts), the Include Posts settings only display the first 10 posts. All 28 posts are displayed OK in the editor and on the front end.

    From an online search it seems that the Query Loop block is limited to display only the first 10 posts in the Include Posts settings, and this is a core WP limitation.

    Is that correct? Is there a way to override this? Or a feasible workaround for them to be able to see all Included Posts in the Query Loop Include Posts settings?

    Is it OK to just select and add new posts via Include Posts in the Query Loop settings, even though many of the already-included posts are not listed there? Or should they re-add the ones which aren’t displayed as well before saving (which is what they’ve been doing and why they’ve asked if anything can be done about this)?

    Sorry for the rambling question, just trying to be clear.

    TIA

  • Hi there,

    I just tested it on my site. I added 20 posts to the query block, and set the posts per page to 20, all 20 posts are showing in the editor.

    And already selected posts will not show in the dropdown.

    Just to confirm, is your client using v1 or v2 blocks? v1 is called Query loop block, and v2 is called Query block.

    Let me know 🙂

  • Hi Ying. As I say, all the posts they have selected are showing in the editor and on the front end, no problem there. It’s just that the Query Loop settings for Include Posts only lists 10 of them (so it does show already-selected posts, with this limit) when the post is opened again for further editing. So when they come to add more posts to the query they’re not sure if they need to add the ones not displayed in that list back in, or if they can safely just add a new post, even though they are not all listed in the settings (but are present on the page and on the front end).

    As I say, the settings seem to be limited by WP core as to how many of them are listed in the settings once the page is published/saved, with the settings showing only the first 10, and seemingly this can’t be overridden. (This according to a web search.) Just wondering if there’s a workaround or if the client should just add more posts as if all the present posts were listed in the settings. Ideally they’d like to see all the posts that are already selected appear in the list.

    It’s v1 blocks throughout the site for now.

  • It’s just that the Query Loop settings for Include Posts only lists 10 of them (so it does show already-selected posts, with this limit

    Yes, that’s expected behaviour. If they can not find the posts in the dropdown, they can also search with the post title or post ID.

    Ideally they’d like to see all the posts that are already selected appear in the list.

    I don’t think that’s very convenient, and a long list like that will drag down the editor’s performance.

  • OK thanks Ying.

  • You are welcome   🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.