Home Forums Gutenberg Post Featured image in acf block


Post Featured image in acf block

  • Hi
    in my acf block
    am doing this
    <?php echo get_the_post_thumbnail_url(); ?>
    to get the url of featured image. but it shows blank.

    tried this also
    <?php echo $featured_img_url = wp_get_attachment_url(get_post_thumbnail_id()); ?>

  • Make sure to pass the post ID to get_the_post_thumbnail_url()

    In a block you can simply reference $post_id to get it.


Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Post Featured image in acf block’ is closed to new replies.