WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] display thumbnails with category archive summary (36 posts)

  1. jampen26
    Member
    Posted 1 year ago #

    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

  2. deepbevel
    Member
    Posted 1 year ago #

    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?

  3. deepbevel
    Member
    Posted 1 year ago #

    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.

  4. jampen26
    Member
    Posted 1 year ago #

    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

  5. deepbevel
    Member
    Posted 1 year ago #

    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">
  6. jampen26
    Member
    Posted 1 year ago #

    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

  7. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

  8. deepbevel
    Member
    Posted 1 year ago #

    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.

  9. jampen26
    Member
    Posted 1 year ago #

    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

  10. deepbevel
    Member
    Posted 1 year ago #

    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.

  11. jampen26
    Member
    Posted 1 year ago #

    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!

  12. deepbevel
    Member
    Posted 1 year ago #

    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.

  13. deepbevel
    Member
    Posted 1 year ago #

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

  14. jampen26
    Member
    Posted 1 year ago #

    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

  15. deepbevel
    Member
    Posted 1 year ago #

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

  16. jampen26
    Member
    Posted 1 year ago #

    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?

  17. deepbevel
    Member
    Posted 1 year ago #

    I'm not sure, but your drop down now has the same font as the top level pages.
    this is what I see in firebug for you top level links:

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

    firebug says your dropdown link style is inherited from that as well.
    So I thought you solved. What are you now trying to do?

  18. deepbevel
    Member
    Posted 1 year ago #

    If your're confused about what your default style.css says, don't worry about it because it's being over ridden by the above code.

  19. jampen26
    Member
    Posted 1 year ago #

    I think it must have been a cache issue.

    It made no sense that the firebug info said one thing, and my stylesheet said another. Cache cleared...problem solved.

    Thanks for the input, much appreciated!

  20. deepbevel
    Member
    Posted 1 year ago #

    your welcome, your blog's looking good.

  21. Joy
    Member
    Posted 1 year ago #

    awesome!!! brillient deepbevel

    i really tried to many more forums for how to show thumbnails in the category.php.

    and Finally i got solution @ ur post...
    Thanks you Brother.. thanks u so much!

    Have a Nice day

  22. deepbevel
    Member
    Posted 1 year ago #

    always welcome

  23. pmtheint
    Member
    Posted 1 year ago #

  24. deepbevel
    Member
    Posted 1 year ago #

    I looked, It's hard to know what you're going for,
    I can at least tell you, look in a template file called "content.php"
    should be the tag "get_post_format" perhaps there you might remove or comment-out the_excerpt.

    You could use a web inspector tool like Mozilla Firebug to find the class selectors you want to adjust for thumbnaiils.

  25. deepbevel
    Member
    Posted 1 year ago #

    okay, maybe try

    .post, .type-page, .type-attachment {
    
     width: 70%;
     clear: none;
    }
  26. deepbevel
    Member
    Posted 1 year ago #

    nice, looks like you've got it under control.

  27. pmtheint
    Member
    Posted 1 year ago #

    he he. I just inserted images on da post, removed featured images and enabled html in excerpts to display the thumbnail image instead :D

  28. pmtheint
    Member
    Posted 1 year ago #

    Thanks for the help.

  29. deepbevel
    Member
    Posted 1 year ago #

    pretty slick

  30. Margo
    Member
    Posted 1 year ago #

    Hey Guys. Not sure if you'll see this but I am trying to do the same thing. There were two places in my loop.php where I could add <?php the_post_thumbnail();?>. I tried each and both and it isn't working :-(. Any advice would be much appreciated!
    dearannabelle.com

    thx!
    m

Topic Closed

This topic has been closed to new replies.

About this Topic