WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] display thumbnails with category archive summary

[Resolved] display thumbnails with category archive summary

  • Hi,

    I am relatively new to wordpress and would like to add featured image thumbnails to my post summaries that appear in the category archives section on my blog (www.thehairychef.com)

    I am not confident with editing code – any help you might be able to offer would be fantastic.

    Thanks!

    J

Viewing 15 replies - 1 through 15 (of 35 total)
  • It may be because your theme is not using

    <?php the_post_thumbnail();?>

    as output for your archives.php or category.php template.

    this may be very simple, however if you are not confident with coding, you may need someone who is.

    Are you using a child theme?

    If your theme is indeed using the_excerpt, you can use a plugin called Advanced Excerpt to customize the output of your excerpts to include thumbnail images. No coding required unless you want to customize per the_excerpt, then you can use template tags to mod output per the_excerpt.

    Hi deepbevel, thanks for the reply.

    I am using the twenty ten theme – not sure if this is a child theme or not. I understand that a child theme is one that you copy and edit/fiddle with to experiment with changes you make to personalise the layout/appearance of the site?

    Anyway, I can’t see this command in my archives.php file or in the category.php one either.

    I am confident enough that if someone tells me where to post it, I can find it and do so.

    Is it supposed to be in or around this line:

    get_template_part( 'loop', 'category' );

    I have seen some video tutorials but wasn’t entirely sure how the php files are connected in a way that left me feeling sure enough about what I was doing, however if it is a simple command that I can post into one or two of these files, Im happy enough to experiment…I just need ot be directed to the right place!

    Thanks again

    J

    In loop.php, find this:

    <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
    			<div class="entry-summary">
    				<?php the_excerpt(); ?>
    			</div><!-- .entry-summary -->

    Add:

    <?php the_post_thumbnail();?>

    directly after:

    <div class="entry-summary">

    Ok, brilliant.

    I found that by posting
    <?php the_post_thumbnail();?> after

    <div class="entry-summary">

    I now see the featured image, but it is displayed as a widescreen type image. I would like it to be a thumbnail that fits in to the left of the text.

    What would I need to do to change the settings of the way this is displayed?

    Thanks again!

    J

    Michael

    @alchymyth

    Forum Moderator

    As for the child theme, it’s basically a copy of your theme, the parts you want to edit. Makes it’s easier to upgrade your theme because it essentially updates around your changes, you won’t have to remember all those changes and re apply them. Also makes it easy to fall back on the default if you mess something up beyond repair.

    I know you guys have given me all the help…but geeze you make me feel smart!

    Just got it and trying to figure out how to wrap text around thumbnails for category excerpt?

    Is creating a child theme easy? (that is to say, if its easy enough to explain, would you mind giving me some directions, so I can go ahead and back up my changes!)\

    thanks again
    J

    You’ll want to use css for wraping text. Post a link to the page.
    I’ve actually never made a child theme, got in the habit of making custom pages for theme tweeks, so it amounts to kind of the same thing. Otherwise I paste all css edits at the bottom of style.css so I don’t change original code.

    Ok, so here’s the page I am working on before I go ahead and rework all the featured images on the blog.

    http://www.thehairychef.com/category/think

    I’d like all featured images to have the excerpts wrapped around them (images floated to the left) but only on the category archive pages.

    Cheers again!

    try this:

    <?php the_post_thumbnail(array( 200,200 ), array( 'class' => 'alignleft' )); ?>

    I could swear this used to work for me in another theme, currently it only puts text and image side by side.

    But I found
    this
    , may be helpful.

    never mind that, it works. I just wasn’t showing enough text in the excerpt to get a wrap.

    brilliant!! Thanks very much – posted it in my loop.php and looks a treat with a little fiddling with the width and float of the image.

    I’m trying to change the font of the drop down menus too – any ideas or suggestions on how I might manage that?

    I’d like the drown down menu to use the same font (Rock Salt) as the page title and the main menu titles.

    Cheers
    J

    Nice, looks like you’ve got the hang of it.

    So re: my question about my drown down menu..

    when i go to inspect element in my browser for each item in the drop down menu it shows the following:

    menu-heading, ol, ul {
    font-size: 16px;
    font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
    font-weight: bold;

    Yet when I go to the saved style.css in my wordpress dashboard it shows the following:

    menu-heading,ol, ul {
    	font-size: 16px;
    	font-family: "Rock Salt", serif!important;
    	font-weight: bold;
    	font-color: #6a6bff;

    This confuses the hell out of me.

    How can I override the default fonts of the theme for blockquotes and dropdown menus?

Viewing 15 replies - 1 through 15 (of 35 total)
  • The topic ‘[Resolved] display thumbnails with category archive summary’ is closed to new replies.
Skip to toolbar