I have some confusion when editing the CSS code in WordPress to display a link to the permalink product details in WordPress. Is there a friend who can help me? This is my code.
<article id="product-<?php the_ID(); ?>" class="productbox">
<div class="content">
<div class="image productbox-image lazy" data-bg="url(<?php echo $thumb;?>)" >
<?php if ($promo == 'on') : ?>
<span class="ribbon">Promo</span>
<?php endif; ?>
</div>
<div class="detail">
<?php
the_title('<h3><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h3>');
?>
<div class="desc">
<?php the_content(); ?>
</div>
<div class="pricing">
<?php
echo $prices;
?>
</div>
Thank you before
2
Answers
You could try changing that
<div>
for image to an<a>
and include the permalink in thehref
of it.Eg:
As we don’t know how specific the CSS selectors are for the div which has
class="image productbox-image lazy" data-bg="url(<?php echo $thumb;?>)"
to ensure the CSS formatting stays the same for it we’ll have to keep it as a div.
What we can do though is wrap it in an anchor element with href the permalink to the details.