WordPress.org

Ready to get started?Download WordPress

Forums

Hide images from excerpt (4 posts)

  1. danchristopher
    Member
    Posted 1 year ago #

    Hi,

    The category pages on my blog show an excerpt of my posts and my theme then allows me to have a small thumbnail image next to the excerpt. It looks nice and neat when working correctly.
    However, within the full post I use larger, header type images that span the width of the post box. The problem is that the excerpt then displays this large image and breaks my layout because it's trying to squeeze it next to the thumbnail created by my theme.

    Is there a way I can remove the images showing up in the excerpt?

    Any help would be appreciated.

    Thanks

  2. Can you provide a link to your site please?

  3. danchristopher
    Member
    Posted 1 year ago #

    Hi Christine, thanks for your reply. The site is actually being hosted locally as I am redeveloping it for my work.

    Here is an image of the post excerpt though so you can get an idea of what I'm talking about:
    http://i50.tinypic.com/jj495e.jpg

    From what I've been reading, am I correct in thinking that the_excerpt() is supposed to remove images by default? If this is the case, does this mean that my theme is using something other than the_excerpt() to display the post excerpt?

  4. If you look in your theme file, you should see next to the excerpt() , the_post_thumbnail.

    You can either remove that or change it to the_post_thumbnail( 'thumbnail' );

    that will ensure that the thumbnail is selected and not the full image.

Topic Closed

This topic has been closed to new replies.

About this Topic