arrow-left
All pages
gitbookPowered by GitBook
1 of 1

Loading...

How to Add Photo Block to the Query Loop

Use Photo Block in a query loop for dynamic images

The Photo Block works well in the default query loop and acts as a featured image.

Let's begin by showing you how to insert a query loop and changing the image to the Photo Block.

hashtag
Compatibility

The Photo Block is compatible with the query loops of the following blocks:

  • core/query

  • generateblocks/query-loop

  • kadence/query

hashtag
Add the Query Loop Block to a Post

Insert the Query Loop into a post using a "/" (Slash) command: /query loop

Choose "Start Blank" and insert the option with an image.

hashtag
Select the Image in the Block Editor

Select the image in the block editor. If the image is selected correctly, you'll see the block type as a featured image.

hashtag
Use the Toolbar to Transform the Image to the Photo Block

Using the Toolbar, click the Transform option to convert the image to the Photo Block.

From there, you can select "Photo Block," and the featured image will be changed over.

hashtag
Alternate Method: Insert the Photo Block Manually

If there is no image in the query loop, you can add one manually. You'd insert a new block and add a Photo Block. The block is smart enough to recognize it's in a query loop and will render immediately.

hashtag
Conclusion

You now know how to add Photo Block to a query loop.

Adding a Query Loop to a Post
Start Blank and Choose an Image Option
Selecting the Featured Image
Transform Options in the Block Toolbar
Demo of Transforming to Photo Block
Inserting the Photo Block Manually