Hi all,
I’m using the new 2022 WordPress-template on my site. In the Visual Editor I want to add a custom field to the Query Loop to display an extra created ACF field.
For this I use the [acf field="fieldname"] shortcode block to add this to the Query Loop. But, no matter what I try, the shortcode isn’t added correctly to the query. Only the value of the last record is shown in each of the article blocks.
Could anyone helpe me out?
Best regards,
Mark
Hi Mark,
I have the same problem and found a solucion for texts:
Unfortunately, the solution is of no use to me personally, as I want to display images via ACF in the query loop block.
But maybe the solution will help you.
After trying a few different solutions to adding ACF fields in a default WP Query Loop, I just found this solution. It seems very simple, and does appear to work fine in my intended use. I have it working on a HTML Block, so I can do whatever formatting is required.
– Anyone know what potential issues this solution might cause in the future?
It seems like it’s just replacing ‘wpautop’ with ‘do_shortcode’ on certain blocks that you enable. Just not sure of any potential cons to this approach. Just seems almost ‘too simple to be true’…