This article assumes you have already integrated WordPress and Magento and are using v1.2.0 or higher.

On a CMS page or static block
If you want to integrate the feeds inline a cms page or on a static block, then you can use the following code:
{{block="wordpress/feed" feedUrl="http://example.com/blog/feed" template="wordpress/feed.phtml"}}
To set custom options, you can just add it into the command, Eg.
{{block="wordpress/feed" maxChar="150" dateFormat="d-m-Y" feedUrl="http://example.com/blog/feed" template="wordpress/feed.phtml"}}
Available custom options
pTitle="Latest news" – Set the block title maxChar="150" – Set the maximum length of the description dateFormat="d-m-Y" – Set the date format (See http://php.net/manual/en/function.date.php) cssId = "rss_style_id" – Set a special CSS Style ID for the ul tag pLimit="10" – Set the maximum number of elements displayed
Via XML
If you are permanently integrating the feeds into the design, then you can do it using XML instead.
<reference name="right"> <block type="wordpress/feed" name="feed.parsefeed" as="rss_feed" template="wordpress/feed.phtml"> <action method="setFeedUrl"><feedurl>http://example.com/blog/feed</feedurl></action> </block> </reference>
To set custom options, you can just add it into the command, Eg.
<reference name="right"> <block type="wordpress/feed" name="feed.parsefeed" as="rss_feed" template="wordpress/feed.phtml"> <action method="setFeedUrl"><feedurl>http://example.com/blog/feed</feedurl></action> <action method="setmaxChar"><maxChar>150</maxChar></action> </block> </reference>
Available custom options
<action method="setpTitle"><ptitle>Latest news</ptitle></action> – Set the block title <action method="setmaxChar"><maxChar>150</maxChar></action>– Set the maximum length of the description <action method="setdateFormat"><dateFormat>d-m-Y</dateFormat></action> – Set the date format (See http://php.net/manual/en/function.date.php) <action method="setcssId"><cssId>rss_style_id</cssId></action> – Set a special CSS Style ID for the ul tag <action method="setpLimit"><plimit>10</plimit></action> – Set the maximum number of elements displayed
Ricardo
11 Apr. 2010
How can I include content or the sidebar inside the home block? I want to put a list of the latest articles just like the picture you have above, but in the home block.. please help me
ben@sonassi.com
11 Apr. 2010
What do you mean by home block? The content block on the cms home page?
Ricardo
12 Apr. 2010
yes, i made it work with your explanations in this page, thanks.
Something is weird, when i set the plimit to 4 it shows 5 posts, when i set it to 3 it shows 4 post, i think its counting from zero, so i think it should show what I set.
I think you have to fix that to avoid confussing people.
For the rest, THANKS, this is what i was looking for.
You should create a method to insert the feeds modifying the .phtml template files.
And a method to actually show the real wordpress widgets in magento.
Ricardo
12 Apr. 2010
I have succesfully created a nice looking News Ticker modifying your implementation a little bit. If you wanna check it you can visit http://www.naturesgarden.com.ec
thanks a lot again.
Christopher
10 May. 2010
I am using magento 1.4.0.1 and wordpress 2.9.2. I have got the blog working, but if I try to use your code for inserting the xml feed in the Magento sidebar, it just falls over. The feed itself works, and I’m using the correct url.
Any idea why I am getting the following error?
[code]Warning: Invalid argument supplied for foreach() in /var/www/magento_ayurved_dev/htdocs/app/code/local/Sonassi/Wordpress/Block/Feed.php on line 15[/code]
I put the XML snippet into design/default/default/templates/local.xml like so:
[code]
http://my-website-url.no/blog/feed
[/code]
ben@sonassi.com
13 May. 2010
Hi Christopher,
Given you’ve not provided me with a URL for the site – I can’t really tell you why it isn’t working
Ricardo
13 May. 2010
Hello, how can i also show the post thumbnail?
It only show title, date and excerpt, but i would like to include the post thumbnail please help me
Thanks in advance
Ricardo
20 May. 2010
Please help me to also show post thumbnail
ben@sonassi.com
14 Jul. 2010
Hi Ricardo,
I’m afraid we don’t have the time to write a guide on this. But if you would like us to develop the functionality, we can do – but it would be for a small fee.
Pavel
12 Jul. 2010
Hi Ben,
I have same error Christopher has. If the wordpress category is empty and have no posts, the feed throws error in magento:
Warning: Invalid argument supplied for foreach() in /home/np27405/domains/magento3.com/public_html/goa/app/code/local/Sonassi/Wordpress/Block/Feed.php on line 15″;i:1;s:3639:”#0 /home/np27405/domains/magento3.com/public_html/goa/app/code/local/Sonassi/Wordpress/Block/Feed.php(15): mageCoreErrorHandler(2, ‘Invalid argumen…’, ‘/home/np27405/d…’, 15, Array)
How can i get over this problem? Is there any chance of just display message “No news at this moment” or just empty block?
Thank You
ben@sonassi.com
26 Jul. 2010
Hi Pavel,
It could probably be easily fixed by adding a simple
is_array()to validate the contents of the variable.Bill
14 Jul. 2010
What about customers and wordpress users? Do the two use the same user table or sync in any way? This looks like an awesome modification. I’d like to give it a try but wondering how to maintain the differences in users roles between the two apps. Any hints would be great.
Thanks for the awesome mod
ben@sonassi.com
26 Jul. 2010
Hi Bill,
They are totally separate, but in the deluxe edition – the customer profile is synced with their WordPress profile (which is dynamically created).
Bill
14 Jul. 2010
Also have you tried this with WP3 and latest magento 1.4.01?
ben@sonassi.com
14 Jul. 2010
Yes, but it did require a couple of modifications, we will be releasing an update shortly.
Jonathan
1 Aug. 2010
Hello, ty for sharing.
I have a question, you have a demo, in that the integration of worpress are in the magento admin, this its a special realise ?
Or i´m doing something wrong?
ben@sonassi.com
1 Aug. 2010
Hi Jonathan,
There is two demo’s “demo.sonassi.com” is the standard WordPress extension; where the theme and basic support for comments is integrated. Whereas the demo shown on http://www.sonassi.com/knowledge-base/magento-knowledge-base/like-our-standard-magento-wordpress-integration-try-the-deluxe-version/ is the deluxe version, which is completely integrated and not only combines the admin, but uses the power of Magento’s MVC framework to control the layout.
Jonathan
1 Aug. 2010
Hi Ben,
Thank you for reply, could you please tell me, how much cost the full integration or package.
If it´s posible send me a email that info.
Steve Evans
11 Aug. 2011
It will be good to to integrate the feeds inline, on a cms page or on a static block from an SEO point of view as it will increase internal linking? Is that right?
Benjamin
17 Aug. 2011
You can, with WordPress Deluxe