Today I turned that code into a Wordpress plugin that creates a widget that displays all your Moodle courses! I developed this plugin for Dearborn Public Schools to better integrate our classroom websites (Wordpress) with Moodle courses to make it easy to get parents and students back and forth between their public wordpress site and private moodle courses.
See an example on our brand new wordpress network setup:
This is a new feature we are offering on our new and improved teacher website portal. I have the joy of moving all these sites this summer to the new wordpress network.
Instructions for use:
- Download and open the file - moodle-courses-widget.php - in an editor.
- Find all the //CHANGE comments in the code and replace the information with your settings. The changes are Moodle database username and password, Moodle database name, and URL to your Moodle site. Each are clearly marked in the code with comments.
- Upload to your Wordpress Plugins directory.
- Either Activate or Network Activate the new plugin "Display a List of Moodle Courses".
- Go to Appearance > Widgets in Wordpress and add the new Moodle WIdget. Give it a title and Moodle username.
- Visit your wordpress site and you should see the new widget with a list of courses.
I should point out that a web administrator needs to hard code a few items which are highlighted in the code by finding the //CHANGE comments. It would not be that hard to make these hard coded parts variables which could be set on the widget settings panel.
See the attached file to download and use.