Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Wordpress latest posts block
 
intensity
Member
 
Total Posts:  48
Joined:  2008-11-22
 

I know there there has been a lot of effort to integrate Magento and Wordpress.  I’m just interested in making a block on my magento front page with the latest posts and that’s it.  I’ve attempted to make a block using the code below.

In my CMS page..

{{block type="core/template" template="blog/testblock.phtml"}}

and then in app/design/frontend/default/default/template/blog/testblock.phtml using the standard WP loop…

<?php
// Include Wordpress 
define('WP_USE_THEMES'false);
require(
'./blog/wp-load.php');
query_posts('showposts=1');
?>
<?php 
while (have_posts()): the_post(); ?>
<h2><?php the_title(); ?></h2>
<?php the_excerpt(); ?>
<p><a href="<?php the_permalink(); ?>">Read more...</a></p>
<?php endwhile; ?>

The error I’m getting is....

PHP Fatal error:  Call to undefined method stdClass::set_prefix() in /Users/xxxxx/Sites/xxxxxx.com/blog/wp-settings.php on line 287

If anyone has been successful at doing this I’d appreciate the help.

Cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
intensity
Member
 
Total Posts:  48
Joined:  2008-11-22
 

I was unable to figure this out so I decided it was easier to just use jquery and ajax to load the data.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top