So I set up an e-store using Zerif Lite’s Bootstrap theme. I’m struggling with trying to add featured products on first page. I’ve tried to use different plugins but they don’t work, so perhaps there’s a specific PHP code for that?
So far I’ve managed to make 1 featured product in Latest News section as a pictured thumbnail, while latest news contains redirect JavaScript code, which redirects to the product page.
I’d like to have several product pictures that have embedded link to each of the products. Hope you can help!
Edit: (Code added)
<div class="latestnews-img">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php if ( has_post_thumbnail() ) : ?>
<?php the_post_thumbnail(); ?>
<?php else: ?> <img src="example.com/mypic.jpg">;
<?php endif; ?>
</a>
</div>
As far as your question, I think this line is the culprit:
You don’t have the semicolon in a php tag, so this could be causing issues.
If you’re not experienced with coding with WP I’d recommend looking at the shortcodes that are included with WooCommerce – there’s one specifically for displaying featured images. That’s probably your quickest and easiest solution.