Quick Tip: Including Recent WordPress Posts in Miva Merchant
The great thing about having a blog for your business is that it gives customers and search engines new content to view. It can increase sales by convincing customers of your product’s benefits, or teaching them how to use it, or giving them ideas for incorporating the product into the lives.
But it’s essential to integrate the blog with your storefront. If customers can’t go back-and-forth between your store and your weblog, the impact of your blog is going to be less than optimal. If you are using Miva Merchant 5 and WordPress, however, one of the simplest ways to integrate the two is to include recent blog posts right on your homepage.
To start out, you need a template that can display a very simple HTML page – one that, in this example, is no more than the title of each post, linked to the full post itself. This can be done by modifying the index.php file within your WordPress template (located in wp-content/themes/your-theme-name). Just add this code at the top of your index.php file:
<?php if ($_REQUEST['pull'] == 1) : ?>
<?php if (have_posts()) : ?>
<?php while (have_posts() && $ctr < 3) : the_post(); ?>
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a><br /><br />
<?php $ctr=$ctr+1; ?>
<?php endwhile; ?>
<?php endif; ?>
<?php else : ?>
The rest of your original index.php should follow this code. Then at the very bottom, close your “if” statement like this:
<?php endif; ?>
At this point, you should be able to see your recent posts by going to the following URL. Be sure to replace “domain.com” with your website domain name, and replace “weblog” with the correct directory for your WordPress installation:
At this point, you’re ready to begin working in Miva Merchant. You’ll need Emporium Plus’s Toolkit module installed. Then, inside Miva Merchant, go to Pages and edit your Storefront (SFNT) page or your Storefront Welcome Message (under Messages). Add the following code (again, replacing the appropriate parts of the URL as specific to your site):
<mvt:item name="toolkit" param="callurl|weblog|http://www.domain.com/weblog/?pull=1|POST|nhour,nminute,nsecond" />
This will print out the list of recent posts from your weblog right on your Miva Merchant storefront.