blank page with wp_get_attachment

I want to use the function “wp_get_attachment” but when I use it, my website shows me a blank page while my server locally, the function shows me what I want…

I went through the canvas without finding an answer.

I proceed like this:

<div class=”credit-photo”>
<h5>
<?php
$idPost = get_the_ID();
$post_thumbnail_id = get_post_thumbnail_id( $idPost );
$at= wp_get_attachment( $post_thumbnail_id );

echo $at[‘description’];
?>
</h5>
</div>

the line that I think problem is :

$at= wp_get_attachment( $post_thumbnail_id );

Do you have an idea ?

Thx !

Read more here:: blank page with wp_get_attachment

Leave a Reply

Your email address will not be published. Required fields are marked *