Hello,
First, let me thank you for making a great plugin. It is useful for many things and in combination with other blocks can make excellent layouts, but the plugin has a small obstacle for my needs.
I have started using the plugin for suggested posts grid that are sorted by title rather than category. However, due to the ability to display only one post, I need to create several columns for each post separately.
Have you considered extending or creating a plugin that could display multiple posts?
Thanks.
]]>Hi Andrew,
First, let me say thanks for creating something that fills such a simple void in the available Gutenberg blocks. It’s *almost* exactly what I needed, and not something I was confident in creating myself.
I’m wondering if it’s possible to have a drop-down that first allows you to select the post type, then select the single post from the available posts in that type?
I modified your plugin locally to query the post type for my needs, but admittedly, I’m not familiar enough with creating blocks to know how I would make that doable from the block settings (instead of modifying the code). I’m not even sure if it’s an easy or hard thing to do! In PHP it would be simple enough to query the available post types, then query the posts within the select post type, but I haven’t got the faintest idea on how to do that within the index.js code.
I think I’m going to use my locally-modified version for now, but that means I won’t be able to update the plugin moving forward… hence my asking if it’s possible to add the option to select the post type first.
Thanks! ??
]]>Actually, when you apply the filter query_loop_block_query_vars on pre_render_block, all the query after your block will be affected.
You should instead use the hook outside pre_render_block, and fetch your conditions inside this hook :
add_filter( 'query_loop_block_query_vars', __NAMESPACE__ . '\filter_my_query', 10, 2 );
function filter_my_query( $query, $block ) {
if ( isset( $block->parsed_block['attrs']['namespace'] ) && 'creativeandrew/single-post-query-loop-selector' === $block->parsed_block['attrs']['namespace'] ) {
if ( isset( $block->parsed_block['attrs']['query']['include'] ) ) {
$query['post__in'] = $block->parsed_block['attrs']['query']['include'];
}
}
return $query;
}
Have a nice day !
]]>Hi Andrew, Is there any way you could consider adding the possibility of also having the article’s featured image? It would be great to also have the article’s featured image as optional. Thank you very much
]]>Hi Andrew
Thanks for developing this plugin – it really meets a need.
Unfortunately I am experiencing glitches with it – I am using Ultimate Blocks Table of Contents on my posts, and that block will not run when your plugin is enabled.
It is a little fussy at the best of times, but it won’t display at all with Single Post Query Loop Selector enabled.
I also experienced a glitch with a post not even displaying in the edit screen at all.
I am running?Tortuga?theme on WordPress 6.4.2. Also a number of other plugins, which of course could be contributing.
]]>