• Resolved annie hearts

    (@annie-hearts)


    Hi,

    I’m trying to make a thumbnail of my featured image appear in excerpts when people search my site or look at tags and categories.

    I tried this suggestion, but the image showed up HUGE and underneath the excerpt.

    Any ideas of how to do this?

    Here’s my website:
    https://www.anniehearts.com

    Thanks for you help!
    Annie

Viewing 15 replies - 1 through 15 (of 16 total)
  • Do you already have a copy of content.php in your child theme?

    Thread Starter annie hearts

    (@annie-hearts)

    Hi esmi!
    Yes I do.

    In content.php, try locating:

    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
    <div class="entry-summary">
    <?php the_excerpt(); ?>
    </div><!-- .entry-summary -->
    <?php else : ?>
    <div class="entry-content">
    <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>

    and changing it to:

    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
    <div class="entry-summary">
    <?php the_post_thumbnail(); ?>
    <?php the_excerpt(); ?>
    </div><!-- .entry-summary -->
    <?php else : ?>
    <?php if( is_tag() || is_category() ) the_post_thumbnail(); ?>
    <div class="entry-content">
    <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
    Thread Starter annie hearts

    (@annie-hearts)

    Hurray!

    It worked perfectly. Thank you!

    Once a rockstar, always a rockstar esmi!

    Thread Starter annie hearts

    (@annie-hearts)

    The right sidebar doesn’t show up though – is that normal in search results?

    No – it should be there. The changes I have above shouldn’t have affected that in any way. Do you have a copy of search.php in your child theme?

    Thread Starter annie hearts

    (@annie-hearts)

    I didn’t, but I just added it!

    You shouldn’t need to. Can you check that the last 2 lines in the parent’s copy of search.php are:

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    Thread Starter annie hearts

    (@annie-hearts)

    Yes, that’s exactly what the parent file’s last two line say…

    I’ll remove search.php from my child theme.

    Can you post a link to your site again, please?

    Thread Starter annie hearts

    (@annie-hearts)

    Thread Starter annie hearts

    (@annie-hearts)

    Hi esmi,

    Just wondering if you’ve had a chance to look at this?

    Thanks!!
    Annie
    anniehearts.com

    Oh – sorry! I lost track of this topic over the weekend. I’ve just checked out your search results page and the sidebar is there but it’s been pushed right to the bottom of the page. This is being caused by a problem with too many </div> tags on the page. My guess is that the actual issue is in yur child theme’s content.php file. Can you paste a copy of it in a pastebin and post the pastebin url here?

    Thread Starter annie hearts

    (@annie-hearts)

    No problem, I appreciate the help!

    Sure, I’ve put it in paste bin. Here you go.

    Thanks!
    Annie

    What happens if you rename this file content-old.php is your child theme?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘twenty eleven: how to make featured image appear as thumbnail in search results’ is closed to new replies.