-
Hi there,
is there a way to configure the GB Query so that it only loads the first featured image of the posts in the editor in order to improve performance in the editor? A toggle for this would be great.
When I think about it, a practical solution would be to use a toggle to override the ‘number of posts’ only in the editor display to 1. That should significantly improve editor performance.
Thanks for your help.
Kind regards, Claus
-
Hi there,
We have a filter to only render 1 post, but no such filter to only render the image of the 1st post.
If it’s ok for you to render 1 post in the ditor, give this code a try:
add_filter('generateblocks_rest_get_wp_query_args', function($args, $props) { // Limit to 1 posts for backend preview $args['posts_per_page'] = 1; return $args; }, 10, 2); -
Thanks, Ying. That’s exactly what I’m looking for. It would be really handy if you could activate it in the editor at runtime using a toggle – and deactivate it when you want to check all posts. How could that be implemented?
-
Alvind
Hi Claus,
Unfortunately, that’s not possible at the moment. Using the filter is the only available method.
-
Ok, I will use this filter. Thanks for your help!
-
Alvind
You’re welcome!
- You must be logged in to reply to this topic.