WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Twelve
Thumbnail above the post title (11 posts)

  1. davidgabunia
    Member
    Posted 1 year ago #

    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() ?>
  2. esmi
    Forum Moderator
    Posted 1 year ago #

    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.

  3. davidgabunia
    Member
    Posted 1 year ago #

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

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Do you have a child theme ready and active?

  5. davidgabunia
    Member
    Posted 1 year ago #

    omg, yes :)

  6. esmi
    Forum Moderator
    Posted 1 year ago #

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

  7. davidgabunia
    Member
    Posted 1 year ago #

    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.

  8. esmi
    Forum Moderator
    Posted 1 year ago #

    Then you're not talking about the post thumbnail (aka "Featured image"). :-)

    Why not just use the Featured image functionality?

  9. davidgabunia
    Member
    Posted 1 year ago #

    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?

  10. esmi
    Forum Moderator
    Posted 1 year ago #

    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.

  11. davidgabunia
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.