WordPress.org

Ready to get started?Download WordPress

Forums

Can't get feature image to float left of text on category page (3 posts)

  1. brookslively
    Member
    Posted 8 months ago #

    I am trying to make a child theme for Twenty Twelve with a custom category page that looks something like this: http://laurenconrad.com/blog/cat/primp. Specifically, I would like to have the feature image to the left and the post title and excerpt to the right. I've tried scouring the internet for solutions but I just keep ending up with the text above or below the feature image. Below is my current attempt that is not working

    I've tried creating a div class with this in the style.css:

    .featuredImage {
    	float: left;
    }

    In my functions.php, I have created a new thumbnail size for the category pages:

    if ( function_exists( 'add_theme_support' ) ) {
    	add_theme_support( 'post-thumbnails' );
            set_post_thumbnail_size( 624, 9999 ); // default Post Thumbnail dimensions
    }
    
    if ( function_exists( 'add_image_size' ) ) {
    	add_image_size( 'category-thumb', 300, 9999 ); //300 pixels wide (and unlimited height)
    }

    Then in my content.php, I have the following:

    <?php if ( is_search() || is_archive() || is_author() || is_tag() ) : // Only display Excerpts  ?>
    			<div class="featuredImage">
    				<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('category-thumb'); ?></a>
    			</div>
    			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                <?php the_excerpt(); ?>

    I'm very inexperienced at this, so I could easily be missing something simple. Thank`you for any help in advance.

  2. brookslively
    Member
    Posted 8 months ago #

    Did I put this question in the wrong forum?

  3. alchymyth
    The Sweeper & Moderator
    Posted 8 months ago #

    Did I put this question in the wrong forum?

    yes - please post in the theme's direct support section http://wordpress.org/support/theme/twentytwelve

Reply

You must log in to post.

About this Topic