Working on trying to get single post image and caption above post content in a custom theme. Can I get the image caption below the image and remaining content below a new div?
Current code:
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h3 class="title no-underline">', '</h3>' ); ?>
</header>
<div class="entry-content news-item-copy">
<?php
$get_description = get_post(get_post_thumbnail_id())->post_excerpt;
the_post_thumbnail();
if(!empty($get_description)){//If description is not empty show the div
echo '<div class="image-captions">' . get_post(get_post_thumbnail_id())->post_excerpt . '</div>';
}
?>
<div class="news-sharing">
<a class="socialite twitter-share" href="" target="_blank" data-via="" data-text="New Website Launch — " data-url="" data-count="horizontal">Share on Twitter</a>
<a class="facebook-like socialite" data-href="" target="_blank" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false">Like on Facebook</a>
</div>
<?php the_excerpt(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'themeName' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
</article><!-- #post-## -->
This works in displaying the post image and excerpt but not the image with caption and not the full post text.
Replacing this:
<?php the_excerpt(); ?>
with:
<?php the_content(); ?>
returns the full post content including the image again.