get attachment title based on attachment id

I’m getting an image through getMeta. It returns me the id of the attachment. Now I want to get the titel, alternative text, description and so on.

For the alternative text this works very well:

Read More
get_post_meta($logo, '_wp_attachment_image_alt', true);

Now I want to get the title. I found out I can do that with $attachment->post_title, but here I only have the id. How do I get the title for an attachment id?

Related posts

Leave a Reply

1 comment