Include WordPress Menus in Moodle Theme
-
Hello,
Apologies if this isn’t necessarily WordPress related.
I am using the open source learning environment Moodle and I am creating a theme for it (using Moodle 2.1)
I am trying to include the menus from my WordPress site into the theme so that they are automatically updated when they are changed in WP.
Ordinarily it would be as simple as including the following code:
<?php
/* Short and sweet */
define(‘WP_USE_THEMES’, false);
require(‘./wp-blog-header.php’);
?>Allowing the menu to be called, like:
<?php
wp_nav_menu( array( ‘sort_column’ => ‘menu_order’, ‘menu_class’ => ‘nav’, ‘theme_location’ => ‘top-menu’ ) );
?>
But for some reason this causes Moodle to crash completely, so I assume there must be some kind of conflict going on.
I was wondering if there is any way to get by this conflict and allow WordPress elements to be called?
If anyone can give me any pointers it would be very much appreciated.
Best regards and a Happy New Year to all!
- The topic ‘Include WordPress Menus in Moodle Theme’ is closed to new replies.