• Hello,

    How to place the post thumbnail above the post title in categories?

    Solution should be here in content.php:

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    		<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
    		<div class="featured-post">
    			<?php _e( 'Featured post', 'twentytwelve' ); ?>
    		</div>
    		<?php endif; ?>
    
    		<header class="entry-header">
    <?php the_post_thumbnail(); ?>
    
    <?php if ( is_single() ) : ?>
    			<h1 class="entry-title"><?php the_title(); ?></h1>
    			<?php else : ?>
    		<h1 class="entry-title">
    				<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
    			</h1>
    			<?php endif; // is_single() ?>
Viewing 10 replies - 1 through 10 (of 10 total)
  • Do not edit the Twenty Twelve theme. It is the default WordPress theme and having access to an unedited version of the theme is vital when dealing with a range of site issues. First create a child theme for your changes.

    Thread Starter davidgabunia

    (@davidgabunia)

    I’m testing on my local server, so can you me help with more specific advice?

    Do you have a child theme ready and active?

    Thread Starter davidgabunia

    (@davidgabunia)

    omg, yes ??

    Hang on a minute – the post thumbnail is already above the post title in categories in 2012!

    Thread Starter davidgabunia

    (@davidgabunia)

    It depends.

    If you will set image in post as a featured image, yes thumb is above the title.

    But if you just insert image in post edit area, thumb is below.

    Then you’re not talking about the post thumbnail (aka “Featured image”). ??

    Why not just use the Featured image functionality?

    Thread Starter davidgabunia

    (@davidgabunia)

    I’m talking about the post thumbnail.
    Do you know how to place the post thumbnail above the post title?
    So if go to categories you will see thumbs above the post title?

    This code:

    <header class=”entry-header”>
    <?php the_post_thumbnail(); ?>

    <?php if ( is_single() ) : ?>`

    places the post thumbnail above the post title in content.php on all pages in the parent 2012 theme.

    So if go to categories you will see thumbs above the post title?

    Yes.

    Thread Starter davidgabunia

    (@davidgabunia)

    ok, I have this code

    `<header class=”entry-header”>
    <?php the_post_thumbnail(); ?>

    <?php if ( is_single() ) : ?>

    in my content.php(as you can see in my first post) but it shows post tumb BELOW the post title.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Thumbnail above the post title’ is closed to new replies.