Forums
Forums / Fixing WordPress / a href thumb
(@fireeee)
14 years, 11 months 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
(@alchymyth)
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>
Thank you. I tried it like that but forgot to put the second > after ?>”
🙁
The topic ‘a href thumb’ is closed to new replies.