Quick Tip: Including Recent WordPress Posts in Miva Merchant

Combining WordPress and 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 weblog 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:

1
2
3
4
5
6
7
8
9
10
<?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:

1
<?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:

1
http://www.domain.com/weblog/?pull=1

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):

1
2
<mvt:item name="toolkit" param="callurl|weblog|http://www.domain.com/weblog/?pull=1|POST|nhour,nminute,nsecond" />
&mvt:global:weblog;

This will print out the list of recent posts from your weblog right on your Miva Merchant storefront.

Tags: , ,

Comments

10 Comments

  • RaiulBaztepo says:

    Hello!
    Very Interesting post! Thank you for such interesting resource!
    PS: Sorry for my bad english, I’v just started to learn this language ;)
    See you!
    Your, Raiul Baztepo

  • Kevin Brown says:

    This code does not work with the recent update to WordPress. Instead it calls the entire blog! Is there a modification we can make to correct the issue?

  • Susan Petracco says:

    Kevin, did you modify the index.php file? Otherwise it will definitely include the entire blog :)

  • Mike says:

    How do you get X number of posts from a specific WordPress catagory. For example: I only want to retrieve 5 posts from the “News” category (cat=3) in my WordPress blog.

  • Gordon from Best Couple Halloween Costumes says:

    Hi. I am new to this blogging game and a site like this is just great resource for help and tips. There seems to be so much to learn and to do with regards to merchandising and store fronts. But hey there is no rush!

  • elfy says:

    Thx for this great resource and i will totatly agree with this post it really is useful and is helping one of my websites rank i am thinking this because i have never had so much traffic

  • leo says:

    This code does not work with the recent update to WordPress. Instead it calls the entire blog! Is there a modification we can make to correct the issue?
    ———————-
    Leo

  • Rob says:

    I’ve got it working correctl… but how do I alter it so I can display more than 3 blog post titles?

  • Susan Petracco says:

    Rob, you just need to change the number “3″ in this line to the number you want to show:

    < ?php while (have_posts() && $ctr < 3) : the_post(); ?>

    So to show 5 posts, you would use:

    < ?php while (have_posts() && $ctr < 5) : the_post(); ?>

  • Tim Ryan from naples real estate says:

    A couple of features that I like are their shipping and tax configuration. It uses your existing FedEx account information that links to your site which means accurate shipping information. Another one is its real-time calculation of U.S. Postal Service rates.
    Tim Ryan@naples real estate recently posted..Bernanke on Housing, EconomyMy ComLuv Profile