WordPress.org

Forums

How to recognize images!? (5 posts)

  1. signalnorth
    Member
    Posted 4 years ago #

    Here's the code I use to fetch my images. The problem is when I put the image in an excerpt WP doesn't recognize it like it does text. It will space the excerpt for text but not for the image. Example can be found here: http://lucaswynne.com/

    Here's the CSS:
    #single_wrap img.index { clear:none!important; float:left!important; margin:6px 15px 0px 0; width:auto; height:auto; max-height:420px; max-width:250px; display:block }

    Here's the fetching code:

    <a href="<?php the_permalink() ?>">
    <?php $image = catch_that_image();
    if( $image ) { ?>
    <img src="<?php echo $image; ?>" class="index" alt="<?php the_title(); ?>" title="<?php the_title(); ?>, <?php comments_number('No comments','One comment','% comments'); ?>" />
    <?php } ?>
    </a>
  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Try adding a min-height to the excerpt_wrap div.

  3. signalnorth
    Member
    Posted 4 years ago #

    Min-height makes it bigger when there's no image too though. Anybody!? Help! HELLLLLP! (Slightly dramatic, but expresses my dismay)

  4. DigitalSquid
    Member
    Posted 4 years ago #

    Add overflow:hidden to .excerpt_inside and remove margin-top:-11px from .index_title

  5. signalnorth
    Member
    Posted 4 years ago #

    You, good sir, are a miracle worker. If there was a like button I would click it vigorously.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags