I'm using Gutenberg editor and I want to add a shortcode (using XYZ PHP Code) that uses the post id to retrieve certain ACF value.
I'm editing the home page where the last blog posts are shown, but I can't find a way to get the post_id
of each item on the loop. I'm using this on the XYZ Shortcode:
<?php echo get_the_ID(); ?>
It always displays the same post_id, the one that belongs to the first post that gets displayed on the list.
How can I get the ID for each item on the loop?
I am missing something here?