# How to call the Caption function in Wordpress media files

**URL:** <https://forum.pinegrow.com/t/how-to-call-the-caption-function-in-wordpress-media-files/6506>\
**Category:** Pinegrow WP\
**Created:** [April 19, 2022, 12:40pm UTC](https://forum.pinegrow.com/t/how-to-call-the-caption-function-in-wordpress-media-files/6506 "2022-04-19T12:40:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mickael](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Mickael](https://forum.pinegrow.com/u/Mickael)\
**Post date:** [April 19, 2022, 12:40pm UTC](https://forum.pinegrow.com/t/how-to-call-the-caption-function-in-wordpress-media-files/6506/1 "2022-04-19T12:40:03Z")

</div>

Hello.

With which Wordpress Action can I call the text Caption of an image?

Thanks

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [April 19, 2022, 3:51pm UTC](https://forum.pinegrow.com/t/how-to-call-the-caption-function-in-wordpress-media-files/6506/2 "2022-04-19T15:51:06Z")

</div>

Hi @Mickael,  
I don’t think that Pinegrow has a built-in action for that, so you will have to use a custom PHP block action instead. The function should be `wp_get_attachment_caption( $post_id );`.  
Good Luck,  
Bob

---

<div class="post-metadata">

**Author:** ![Mickael](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Mickael](https://forum.pinegrow.com/u/Mickael)\
**Post date:** [April 20, 2022, 12:20pm UTC](https://forum.pinegrow.com/t/how-to-call-the-caption-function-in-wordpress-media-files/6506/3 "2022-04-20T12:20:58Z")

</div>

Hi @RobM ,  
Thanks for your suggest. It’s Work.

For a single.php page i use :

```auto
wp_get_attachment_caption( $featuredID = get_post_thumbnail_id() );

```

Have a Good day
