I would like to display a Wordpress Menu in the OpenCart Header. In my test.php page I added the following code;
<?php
require($_SERVER['DOCUMENT_ROOT'].'/wordpress/wp-load.php');
wp_nav_menu( array( 'menu' => 'Test' ) ); ?>
And it works great, however when I add that into the header.tpl template in OpenCart I receive an error;
Fatal error: Call to a member function get_queried_object() on a non-object in /....../wordpress/wp-includes/nav-menu-template.php on line 256
Can you assist? Have you done this before? Seems that OpenCart is causing the problem?
APPENDED UPDATE ON PROGRESS BELOW
Okay, I have run default installations of OC and WP.
Wordpress is in the root - www.test.local Opencart is in the root/store directory - www.test.local/store/
In the Opencart Default Tenplate Header I have the following code:
<?php $path = $_SERVER['DOCUMENT_ROOT'].'/wp-load.php';
echo $path;
require_once($path);
wp_nav_menu( array( 'menu' => 'Test' ) ); ?>
Which Generates the following error:
test.local/Sites/test.local/htdocs/wp-load.phpNotice: Constant DB_PASSWORD already defined in test.local/Sites/test.local/htdocs/wp-config.php on line 25Unknown: Redefining already defined constructor for class WP_Widget in test.local/Sites/test.local/htdocs/wp-includes/widgets.php on line 93Warning: strpos() expects parameter 1 to be string, array given in test.local/Sites/test.local/htdocs/wp-includes/functions.php on line 3048
Fatal error: Call to a member function get_queried_object() on a non-object in test.local/Sites/test.local/htdocs/wp-includes/nav-menu-template.php on line 256
Interestingly though, when I delete the 'Test' Menu from Wordpress, the menu displays in Opencart, However I still see the following error:
/Sites/test.local/htdocs/wp-load.phpNotice: Constant DB_PASSWORD already defined in /Sites/test.local/htdocs/wp-config.php on line 25Unknown: Redefining already defined constructor for class WP_Widget in /Sites/test.local/htdocs/wp-includes/widgets.php on line 93Warning: strpos() expects parameter 1 to be string, array given in /Sites/test.local/htdocs/wp-includes/functions.php on line 3048Notice: Trying to get property of non-object in /Sites/test.local/htdocs/wp-includes/post-template.php on line 845
A clue? Anyone got any ideas?