WordPress.org

Ready to get started?Download WordPress

Forums

a href thumb (3 posts)

  1. fireeee
    Member
    Posted 3 years ago #

    I have a php related question.

    I have this

    <?php if ( has_post_thumbnail() ) { ?>
    <?php the_post_thumbnail(array(100,100), array('class' => 'alignleft')); ?>
    <?php } ?>
    <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>

    This brings out a thumb and a link to the post on the sidebar. My goal is to make the thumb a link to the post too.

    Happy Easter

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    put the link around the thumb; for instance:

    <?php if ( has_post_thumbnail() ) { ?>
    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    <?php the_post_thumbnail(array(100,100), array('class' => 'alignleft')); ?>
    </a>
    <?php } ?>
    <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <?php the_title(); ?></a></h2>
  3. fireeee
    Member
    Posted 3 years ago #

    Thank you. I tried it like that but forgot to put the second > after ?>"

    :(

Topic Closed

This topic has been closed to new replies.

About this Topic