Answer the question
In order to leave comments, you need to log in
How to make an image clickable?
I wanted to make a preview image in wp clickable on the article (href="<?php the_permalink(); ?>" ) didn't work on my own
<div id="post-<?php the_ID(); ?>" <?php post_class( 'product1' ); ?>>
<?php
if ( $cwp_rev_product_image ) {
echo '<div class="product1-image" style="background-image: url('. $cwp_rev_product_image .')"></div>';
} else {
echo '<div class="product1-image" style="background-image: url('. get_template_directory_uri() .'/images/no-image2.png)"></div>';
}
?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="product1-title">
<?php the_title(); ?>
</a><!--/a. product1-title-->
<?php
if ( $option_overall_grade ) {
echo '<div class="product1-stars"><div class="stars_active" style="width: '. $option_overall_grade .'%;"></div></div>';
}
if ( !empty( $affiliate_text ) && !empty( $affiliate_link ) ) {
echo '<div class="affiliate-button2 affiliate-button button-buy">';
echo '<a href="'. $affiliate_link .'" rel="nofollow" target="_blank">';
echo '<span>'. $affiliate_text .'</span>';
echo '</a>';
echo '</div>';
}
?>
</div><!--/div .product1-->
Answer the question
In order to leave comments, you need to log in
<div id="post-<?php the_ID(); ?>" <?php post_class( 'product1' ); ?>>
<a href="<?php the_permalink(); ?>">
<?php
if ( $cwp_rev_product_image ) {
echo '<div class="product1-image" style="background-image: url('. $cwp_rev_product_image .')"></div>';
} else {
echo '<div class="product1-image" style="background-image: url('. get_template_directory_uri() .'/images/no-image2.png)"></div>';
}
?>
</a>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="product1-title">
<?php the_title(); ?>
</a><!--/a. product1-title-->
<?php
if ( $option_overall_grade ) {
echo '<div class="product1-stars"><div class="stars_active" style="width: '. $option_overall_grade .'%;"></div></div>';
}
if ( !empty( $affiliate_text ) && !empty( $affiliate_link ) ) {
echo '<div class="affiliate-button2 affiliate-button button-buy">';
echo '<a href="'. $affiliate_link .'" rel="nofollow" target="_blank">';
echo '<span>'. $affiliate_text .'</span>';
echo '</a>';
echo '</div>';
}
?>
</div><!--/div .product1-->
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question