post_excerpt is actually the caption attribute. Here is the correct answer:
$title = get_post(get_post_thumbnail_id())->post_title; //The Title
$caption = get_post(get_post_thumbnail_id())->post_excerpt; //The Caption
$description = get_post(get_post_thumbnail_id())->post_content; // The Description
Related Posts:
- Set Featured Image for Archive templates
- How can I add a set featured image function to a theme that doesn’t already have it built in?
- Can I apply a WP theme to a specific custom page template?
- Can I create multiple instances of the BuddyPress Activity Stream with separate themes? [closed]
- How do you get thumbnails to show up in the admin edit post?
- How to use get_page_by_title() with qTranslate?
- Display a specific dynamic sidebar widgets on a specific page
- 100% width Featured Image Size
- Multi-level page hierarchy
- Own Theme Customizer displays error message when saving, saving still works
- Customizing page content layout
- Putting two themes together to create a complete site
- Featured images, am I missing something?
- Make multiple pages and set template/content on theme activation?
- How to restore file or theme?
- How to transform a custom made static HTML website to a WordPress website [closed]
- Recommended Media Size for Twenty Fourteen
- get_the_post_thumbnail() produces different HTML on same arguments
- How to edit the font color of the H1 on a single page?
- How to use custom page templates in a theme that hides page template option?
- Setting a new default template for the creation of a page
- Index page is not working
- Migrating a website using custom image tags to use featured images instead
- Custom theme – pages in menu
- remove preloader in WordPress theme [closed]
- How do I get the featured image to sit below the header in the twenty nineteen theme?
- Custom CSS is overwritten by WordPress?
- Edit box-header on WordPress Dashboard
- Featured images are cropped on index and post page
- Change theme’s thumbnail to cropped WP featured image
- Theme stops media uploader from working
- adding a unique page to an existing site
- separate home page into separate pages
- wordpress template page Usage [duplicate]
- How to create an Single-Portfolio page?
- W3 Total Cache, CDN and theme files [closed]
- Switching themes without losing widgets?
- How to use media upload on theme option page?
- WordPress 5 / Gutenberg – theme doesn’t have featured image option showing up
- How to refresh WordPress Customizer panel upon entering a value
- Multiple image logo for theme
- Hide Twenty Eleven Theme From Themes Page
- How do I change Twenty Nineteen’s primary color without using the color slider in the theme customizer?
- How to add the main style.css to my index.php?
- Remove action within a class in a parent theme from the child theme
- How to move WordPress theme files into a subfolder without breaking the theme?
- remove rel=next on home page but not others
- Is it possible to use child theme of child them?
- Disable Sidebar in the Product Page in Storefront Theme [closed]
- Renaming the Twenty Fourteen WordPress theme
- Defining different theme for Blog posts page
- How to understand a specific bit of WordPress syntax
- How to unset comment_notes_before field in WordPress comment_form
- How to loop over wp_get_themes() and create an array of themes name
- Custom options below pages/posts editor?
- Fatal error with a theme
- WordPress theme options and insert default value for serialize data
- Restrict access to specific widget field based on user role
- Twenty Twelve theme search returns Nothing Found
- WooThemes PremiumNews Theme jQuery Conflict with WordPress 3.2
- The Cost of Installing Custom Themes
- Can I create a child theme from a premium theme without losing my posts and page etc that I already have?
- Change copyright text on the footer section [closed]
- Re-skinning Site
- How to reset a custom theme
- Warning : Invalid argument supplied for foreach() in theme php on line 56 [closed]
- Cannot changing login button color, have tried theme, plugins… is it GoDaddy managed?
- Why submenu item’s background color is not changing by css?
- Cannot see theme in my search
- What login/password do I need to install a wordpress theme?
- get_pages Not accepting my query
- Date based CSS/theme
- Functions.php error – when trying to change the theme
- Make a menu item unselectable
- conditional statement if wordpress theme block is empty then hide block
- Can I use non-wordpress themes in WordPress?
- jQuery is not defined – some theme features do not work!
- How can I modify the CSS only for the search results page of WordPress?
- SVG icons in Twenty Nineteen
- Does anyone know where to find the area to edit this text
- fixing page URL’s
- Don’t prepend WordPress base url to image paths
- Issues with dynamic widget in theme customizer
- Theme Dev | Convert Template to Theme
- How to Solve the WordPress Cron Job Site Slow down Problem?
- How do I get the path to the currently in use theme’s directory?
- Pagination not working in home page
- Show part of front page on another page [closed]
- Any Mobile Theme Switcher – Theme not complete (Stylesheet missing)
- permissions on themes directory
- Categorising themes by folders in backend
- Theme Options Menu Item – Permission Issue
- totally confused about editing wp theme….new guy to wp
- Header Paperpunch theme disappers with IE9 [closed]
- Why does twentysixteen take a free hand in dealing with longstanding usability principles? [closed]
- How do you add a featured image to a page (not post)?
- My theme switches to “Twenty twenty two” on its own even if deleted
- Check if style is declared in child theme from within parent theme. if so, use that style in parent theme
- Every newly created page links to the same deleted page
- Homepage not loading correctly, only after refreshing