Wordpress Header in Moodle

Wordpress Header in Moodle

by Liam Knight -
Number of replies: 5

Hello I am trying to use the wordpress header inside Moodle instead of using the menu in the theme we are using (Essential)

I have tried adding it using this php code below in the header.php file of the theme but that didn't work and caused the site only to load the background, I also tried adding it in the "additional HTML" area but that didn't make any difference.

Does anyone know how this can be done as it will be really useful to make the site seamless and we don't want to use iframes as they are no good to us.

Any help is greatly appreciated, thank you.

<?php require('/XXX/public_html/wp-blog-header.php'); ?>
<?php require('/XXX/wp-content/themes/ourtheme/wp-blog-header.php'); ?>
Average of ratings: -
In reply to Liam Knight

Re: Wordpress Header in Moodle

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

You need to add the file into the layout folder of your theme and link from the page header of your theme's layout file general.php or whatever it's name using this method...

<?php include('wp-blog-header.php'); ?>

Read: http://www.w3schools.com/php/php_includes.asp

Cheers

Mary

In reply to Mary Evans

Re: Wordpress Header in Moodle

by Liam Knight -

Hello Mary,

Thanks for your reply, I have tried this but when I add this to the header.php file it only loads the background of the page. I have also tried putting hte wp-blog-header.php into the layout folder and get the same result. 


I would really like to get this working as it would make the site a lot better, thank you for your reply.

In reply to Liam Knight

Re: Wordpress Header in Moodle

by Liam Knight -

Nobody had any idea about this? It would be really useful.

In reply to Liam Knight

Re: Wordpress Header in Moodle

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

This all depends on what is in those PHP files. What does the header do. I don't use Wordpress and as far as I recall it is not really that compatible with Moodle. So the WP php would need to be modified for it to work.

Some links or images to the kind of header would be good.

Thanks

Mary

In reply to Liam Knight

Re: Wordpress Header in Moodle

by Jack Dunstan -

I'm keen to hear if you resolved this. I think the Wordpress REST API could provide this functionality.