My mission:
I have a system that could have been a standalone website, but I would like to be a part of an existing CMS so that I can avoid writing my own user management system, forum, blog system, etc. I could have made it as a component in Joomla! as I have been working with that before, but unfortunately I do not like Joomla! and have therefore chosen WordPress.
My problem:
My system should both have admin pages and front end pages available inside my WordPress page. I have been able to create a plug-in and add admin pages, but I have yet to find out how to make the front end.
One solution could be to create a page-template in my chosen theme, but as I want to seperate my component from WordPress as much as possible, and also want it to be theme-independent this is a bad solution.
How can you help:
Please provide me with a simple example or guide me towards either a tutorials or an existing WordPress plug-ins for me to look at to be able to make my plug-in. Bear in mind that this plug-in should only be used on my page and that I only want to use WordPress as a shell for the plug-in
One way to do what I think you need is to create a custom template file that you can drop into any theme. Then you just need to create an empty WordPress page through the wp-admin back end and set the page template as ‘MyPluginPageTemplate’. The template page is theme independent, and can be dropped into any or all themes in the system.
For instance, create a file called ‘myplugin-template.php’ and save it in the root of the active theme’s folder. (eg /wordpress/wp-content/themes/activetheme/myplugin-template.php)
Put the following code in the file:
In this example I’m using a plugin which is contained in a class, but it could be just a straight function like ‘myplugin_init()’.