How to display featured products on home page using Zerif Lite on WordPress with WooCommerce?

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.

Read More

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>

Related posts

Leave a Reply

2 comments

  1. As far as your question, I think this line is the culprit:

    <?php else: ?> <img src="example.com/mypic.jpg">; 
    

    You don’t have the semicolon in a php tag, so this could be causing issues.