We are using the above combo and the instructions need changes to reflect new line numbers and a check on the wordpress inclusion in index.php
1. find index.php in the root of your magento installation and find the following line of code
require_once $mageFilename;
and add the following after it
if (strstr($_SERVER[’REQUEST_URI’], “/wordpress/")) {
define(’WP_USE_THEMES’, true);
require(’./wordpress/wp-blog-header.php’);
}
Note the “/wordpress/”. Make that match where ever the public sees the blog. Putting it in the REQUEST_URI resolves the page 2 issue that people were having when you paginated the products page on magento and you have an active ‘page’ in the wordpress CMS.
you will need to be sure that the second line points to the location of your wordpress installation, as it is, it assumes wordpress in installed in the magento directory.
2. in wordpress/wp-settings.php find the following lines of code and remove the & symbol
Line 520
$wp_the_query =& new WP_Query();
Line 535
$wp_rewrite =& new WP_Rewrite();
Line 542
$wp =& new WP();
Line 578
$wp_locale =& new WP_Locale();
also in wordpress/wp-settings.php remove or comment out the following lines
function __($text, $domain = ‘default’) {
return translate($text, $domain);
}
to
if (!function_exists(’__’)) {
function __($text, $domain = ‘default’) {
return translate($text, $domain);
}
}
4. now to the wordpress part. copy the theme in wordpress_module_files/wordpress-theme into wordpress\wp-content\themes
5. log into the admin panel of wordpress and click settings. then change the “Blog address (URL)” to http://yoursite.com/magento/blog change to fit your site, but leave the blog part. Save settings then Click permalinks. Ensure permalinks are set to default. Finaly goto design and select the magento theme installed in step 4.
6. now go to http://yoursite.com/magento/blog to access the blog.
I have made all the changes given above. I could see the blog in the magento home page right sidebar. However if I click the blog link it will take to me blank page . I don’t know where I am wrong. Please give me your solution for this issue.
Please notice that the url in the 1. line in the 1. step has to be similar to the url in the 5. step. (/blog and /blog, not /wrdpress and /blog as described).
If it still doesn’t work please doublecheck all the instructions in the first and third post.
The line numbers may be different!
I used Wordpress 2.8 and nearly every line specification was “wrong”.
Thanks. Now its working fine. I have another doubt. Can we integrate Wordpress admin into magenta admin? Is it possible to integrate both admin modules.
"Impossible is nothing” to quote some advertising…
You just have to write a module which adds some functionality to the magento backend. The wordpress database structure is really easy.
INSERT INTO wp_posts
should do the job.
sherrie - 12 June 2009 12:04 PM
The error is showing up on any magento pages:
Fatal error: Call to undefined function is_404() in /app/design/frontend/default/gladrag/template/blog/menu.phtml on line 28
While the sidebar works fine on any blog pages. Any ideas?
Having the same problem right now.
I assume its a problem with the path/skin/template. Using the enterprise edition?
Fatal error: Call to undefined function is_404() in /var/www/shop/app/design/frontend/default/default/template/blog/menu.phtml on line 28
//Edit:
Here’s another thread with the same problem (404):
http://www.magentocommerce.com/boards/viewthread/38528/
Awesome quote..Even I am new to Magento. I have been started since last Monday. I couldn’t find how to create the custom modules in Magento. Do you have any document or tutorial or sample code to do this. It would be helpful to integrate Wordpress admin into Magento admin. Thanks!
When installing the module in the Magento Connect admin, shouldn’t that installation set up a Wordpress folder in the root folder? I don’t find that folder and neither the files that should be modified according to this discussion. Can anyone make a screencast of this? I would pay for something like that as I’ve heard that the Lazzymonk pluggin is the best blog plugin for Magento. Is there anything else I could use instead of Lazzymonk/Wordpress?
Let’s see if I can do it this time. Just a short question. The index.php-file that should at first be modified with adding that code. Is that the Magento index.php file that lies in the Magento root folder or the Wordpress installation folder?
Solved below by correcting the php code as my text editor didn’t copy the right characters from the webbrowser into the code.
I have done everything that is written above but I end up with this error message. Does anyone know what causes this problem? I don’t have the default Magento theme but a custom made one.