Why are product images, title, etc all wrapped in the same a tag?
-
Why do you take the lazy way out and do this.
<a class="woocommerce-LoopProduct-link woocommerce-loop-product__link" href="https://mysite.com/product/myproduct/"><img width="300" height="150" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="" src="https://mysite.com/wp-content/uploads/2014/12/myimage.jpg"><h2 class="woocommerce-loop-product__title">My Title</h2> <span class="price"><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>xxxx</span> – <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>xxxx</span></span> </a>
Instead of this….
<a class="woocommerce-LoopProduct-link woocommerce-loop-product__link" href="https://mysite.com/product/myproduct/"><img width="300" height="150" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="" src="https://mysite.com/wp-content/uploads/2014/12/myimage.jpg"></a> <a ... ><h2 class="woocommerce-loop-product__title">My Title</h2></a> <span class="price"><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>xxxx</span> – <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>xxxx</span></span>
Wrapping multiple elements in the same a tag creates some layout problems. For example if I want to add a description after the title I then have to close off the previous a tag or else the description is also linked.
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Why are product images, title, etc all wrapped in the same a tag?’ is closed to new replies.