• I’m in the early stages of building a new site and I’m stumped. I’ve read tons of posts, but can’t seem to solve this riddle. Here’s the URL:

    http://www.tradeshowfocus.com

    I’m using the 2012 Theme with a Child Theme.

    In my posts I’m going to use large images. In my categories and tags, I’d like to show smaller images that link to the post. Right now, I’m using the <– More –> button to display the partial post, but it pulls the original sized image.

    If I edit the Category Template to pull and display the Excerpt, then I can’t seem to get the image.

    Based on the posts I’ve read, I think there are a couple of ways to solve this, but I can’t seem to get anything to work.

    Here is my simple category.php file from the child theme. It’s basically a copy from the parent theme:

    `<?php
    /**
    * The template for displaying Category pages.
    *
    * Used to display archive-type pages for posts in a category.
    *
    * Learn more: http://codex.wordpress.org/Template_Hierarchy
    *
    * @package WordPress
    * @subpackage Twenty_Twelve
    * @since Twenty Twelve 1.0
    */

    get_header(); ?>

    <section id=”primary” class=”site-content”>
    <div id=”content” role=”main”>

    <?php if ( have_posts() ) : ?>
    <header class=”archive-header”>
    <h1 class=”archive-title”><?php printf( __( ‘Category: %s’, ‘twentytwelve’ ), ‘<span>’ . single_cat_title( ”, false ) . ‘</span>’ ); ?></h1>

    <?php if ( category_description() ) : // Show an optional category description ?>
    <div class=”archive-meta”><?php echo category_description(); ?></div>
    <?php endif; ?>
    </header><!– .archive-header –>

    <?php
    /* Start the Loop */
    while ( have_posts() ) : the_post();

    /* Include the post format-specific template for the content. If you want to
    * this in a child theme then include a file called called content-___.php
    * (where ___ is the post format) and that will be used instead.
    */
    get_template_part( ‘content’, get_post_format() );

    endwhile;

    twentytwelve_content_nav( ‘nav-below’ );
    ?>

    <?php else : ?>
    <?php get_template_part( ‘content’, ‘none’ ); ?>
    <?php endif; ?>

    </div><!– #content –>
    </section><!– #primary –>

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>’

    Exactly what code do I need to put where? Thank you so much for the help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You’re wanting to put a thumbnail next to each post, correct?

    This is usually done in the index.php file.

    I usually put <?php the_post_thumbnail() ?> somewhere in there and wrap a div around it.

    <div class="post_thumbnail">
    <?php the_post_thumbnail() ?>
    </div>

    Then you can position it and style it however you’d like.

    Thread Starter Jeff McEachron

    (@jmceachron)

    On this page I would like to make the image smaller and have it link to the post. Does that clarify it a little? Thanks!

    Where you have the code listed with the thumbnail, you can try changing it to this…

    <a href='<?php the_permalink(); ?>' title='<?php the_title();?>'> <?php the_post_thumbnail('') ?></a>

    Then you can do something like add this in the functions.php of your theme folder…(150,150 being max width and max height)
    set_post_thumbnail_size( 150, 150 );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display Thumbnail Images on Categories and Tags’ is closed to new replies.