Category wise Latest Product Posts for Home Page
-
I need it for Particular Category Product Posts. Title of the Product Post and Product Image.
<?php $SelectedPosts = new WP_Query('cat=4&showposts=6'); if($SelectedPosts->have_posts()): while($SelectedPosts->have_posts()) : $SelectedPosts->the_post(); ?> <ul class="home_posts"> <li> <?php if ( has_post_thumbnail() ) { the_post_thumbnail('home_posts'); } else { ?> <img class="home_image" src="<?php bloginfo('template_directory'); ?>/images/placeholder.png" alt="<?php the_title(); ?>" /> <?php } ?> <div class="overlay"> <h3><?php the_title();?></h3> <a class="info" href="<?php the_permalink(); ?>">View Details</a> </div> <span><?php the_title();?></span><br /> <span>Rs.750/-</span> </li> </ul> <?php endwhile; else : ?> <p>No Updates</p> <?php endif; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Category wise Latest Product Posts for Home Page’ is closed to new replies.