Query Block : toggle to not display all the posts in editor as an option
Description
When one wants to show a larger number of posts per page it becomes cumbersome to load each time editor is opened or reloaded to show all these. On the front one cam cache these etc. But if one is building a complex page with several sections, each with query block it can become difficult for gutenberg to hangle displazing these in editor.
Steps for testing
- Make a query set posts per page to 40.
- Set another section with 10 posts.
- Another with 10
- Ssave page and close it.
- Open it again ... it takes a while to load.
Solution:
Would be nice to have a toggle "dont show posts in editor" so that they can not be rendered when not needed. Editing of pages would be more elgant like this.
@thisbit indeed it would be cool to have such option, but we need to think in a good system, cause in some cases like two column layouts you may want to display 2 posts. Maybe a filter that you can overwrite the per page configuration only in the editor. We will defenetly consider this for future version, thank you.
Maybe have a posts per page for editor toggle that does not affect the front?
@thisbit we have introduced a post cap for the editor, the default is 50 posts. You can easily change with the following filter:
add_filter( 'generateblocks_query_loop_editor_posts_cap', function() {
return 10;
} );