I want to add a featured product at the top of index wordpress page. Basically it will have an image and title of posts. There are a lot of plugin available for featured product but those are not fulfill my requirement.
So today I am trying to create custom featured product based on category name and number of product parameters.
I have done too much goggling but did not found satisfying answer, so below I am describing how to create featured product in simple steps.

Simple step to create featured product in wordpress.
Step 1: First We will create a category in wordpres name is ‘Featured Product’.
Step 2: Create CSS class for featured div.
Step 3: Now we will paste below code in index.php file Or where you want to display featured product:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
<div class='featured-container'>
<div class='featured-item-title'>Featured Product</div>
<?php $postslist = get_posts('numberposts=10&order=DESC&category_name=Featured'); foreach ($postslist as $post) : setup_postdata($post);
?>
<div class="recent-posts-item">
<div class='img-thumbnail'><a href="<?php the_permalink(); ?>">
<?php
if(has_post_thumbnail()) {
the_post_thumbnail('thumbnail', array('class' => 'featured-thumb'));
} else {
echo '<img class="featured-thumb" src="http://phpflow/image_not_available.png"
alt="<?php the_title(); ?>" class="footer-thumb" width="150px" height="150px" />';
}
?>
</a></div>
<div class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
</div>
<?php endforeach; ?>
</div>
