Forum Replies Created
-
AuthorPosts
-
m.l.cap123
ParticipantI figured it out. Here’s the original code:
<div class="service-item clearfix"> <?php if ( has_post_thumbnail() ) { echo'<div class="service-icon">'.get_the_post_thumbnail( $post->ID, 'icon' ).'</div>'; } ?> <h3 class="service-title"><?php echo $page_title; ?></h3> </div><!– .service-item –>
And here’s the new code:
<div class=”service-item clearfix”>
<?php
if ( has_post_thumbnail() ) {
echo ‘ID ) . ‘” title=” ” ‘ . esc_attr($thumbnail->post_title ) . ‘”>’;
echo'<div class=”service-icon”>’.get_the_post_thumbnail( $post->ID, ‘icon’ ).'</div>’;
}
?>
<h3 class=”service-title”><?php echo $page_title; ?></h3>
</div>
<!– .service-item –>m.l.cap123
ParticipantThanks. I’m trying to add an anchor which I think looks like this:
‘<a href=”<?php
the_permalink(); ?>” title=””><?php echo $page_title; ?>‘
I’m adding it here:
if ( has_post_thumbnail() ) {
echo'<div class=”service-icon”>’.get_the_post_thumbnail( $post->ID,
‘icon’ ).”<a href=”<?php
the_permalink(); ?>” title=””><?php echo $page_title; ?>‘</div>’;
}
?>It’s breaking the site so I loaded the original file. Can you be more specific about where exactly I need to add the code and what exactly the code should be? Thanks.
-
AuthorPosts
