• Hi,

    In a child theme based on Cerauno, I’d like to move the featured image to be below (rather than above) a post’s title. I need to use the featured image, rather than simply place any image where I want it, because that affects the index.

    The most logical place to do this is in ‘content-single.php’ but I the file doesn’t contain any explicit reference to ‘featured-image’. (The only direct reference I could find in the template only affects the index.) Anyone have any idea how to do this?

    Thanks! Here’s the default content of ‘content-single.php’:

    <?php
    /**
     * Template part for displaying single posts.
     *
     * @package Cerauno
     */
    
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<header class="entry-header">
    		<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    	</header><!-- .entry-header -->
    
    	<div class="entry-content">
    		<?php the_content(); ?>
    		<?php
    			wp_link_pages( array(
    				'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'cerauno' ),
    				'after'  => '</div>',
    			) );
    		?>
    	</div><!-- .entry-content -->
    
    	<footer class="entry-footer clear">
    		<?php cerauno_entry_footer(); ?>
    	</footer><!-- .entry-footer -->
    </article><!-- #post-## -->
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey,

    content-single.php is for the blog post once visited, not the blog view. The file that you want to look at is index.php, since this is the file that will be read when someone accesses your blog. Looking at index.php it calls another file:

    get_template_part( 'template-parts/content', get_post_format() );

    So if you take a look at content.php which can be found in /template-parts/ it has the following code:

    <div class="featured-image">
    				<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'cerauno-home' ); ?></a>
    			</div>

    Eiditing t

    Thread Starter wp

    (@voipben)

    Hey Simon,
    Thanks! Appreciate the explanation of content-single.php vs. content.php. Very helpful.
    Yeah, that’s the one place (content.php) where I saw the reference, but it only affects index.php (‘cerauno-home’). Can’t seem to get it to adjust on single post pages.
    Any ideas?
    Thanks again.

    Are you sure that the featured images are being displayed on the blog posts and not the blog index. I don’t see how it could be since its not being called.

    Thread Starter wp

    (@voipben)

    So, I’m not crazy. Thanks. But, yes, I am certain. If a featured image is selected it automatically appears at the top of the single post page, above the post title. I wonder if this could be a default WP mechanism, independent of the theme.
    Appreciate the help.

    Moderator Kathryn Presner

    (@zoonini)

    We are working on this in another thread so I’m closing this one as a duplicate.

    https://wordpress.org/support/topic/moving-featured-image-in-single-posts

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Theme: Cerauno] placing featured image below title in single post’ is closed to new replies.