• https://www.littleseedsfarmschool.com

    I am working on using WP’s featured image to add a large image to the header of each post template (directly under the “Written by…” post meta and above the post body) but I cannot seem to get them to display.

    I have enabled theme support for post thumbnails, added a custom image resize in functions.php for them, regenerated thumbnails and attempted to output the image using echo the_post_thumbnail.

    It appears as though content-single.php is somehow not displaying the div.post-header-image or the featured image call that I have created during it’s loop.

    Have tinkered on this for many hours and am clearly missing something important. Any help would be infinitely appreciated!

Viewing 1 replies (of 1 total)
  • Thread Starter guild_of_wolves

    (@guild_of_wolves)

    Here is the relevant piece of my content-single.php:

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    	<header class="entry-header">
    		<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    
    		<div class="entry-meta">
    			<?php littleseedsfarmschool_posted_on(); ?>
    		</div><!-- .entry-meta -->
    
                    <div class="post-header-image">
    	                <?php echo the_post_thumbnail('post-header-image'); ?>
    		</div>
    
    	</header><!-- .entry-header -->

    Here are the two additions to my functions.php:

    add_theme_support( 'post-thumbnails' );
    
    add_image_size('post-header-image', 960, 300, true);

    Thanks again!

Viewing 1 replies (of 1 total)
  • The topic ‘[Underscores] Featured Image Not Appearing’ is closed to new replies.