I'm trying to mod a custom-cms module to a WordPress plugin.
The plugin consists only of an admin-part. The part the visitor sees is loaded via a regular WordPress Page with PHP code embedded. This works fine.
For the admin part, I've created a separate folder within the plugins dir, containing two PHP files. The plugin is activated, and the menu-item loads properly. However, the problem I'm having, is that the admin content of the plugin is loaded A) in every wordpress admin page, and B) all the way at the top of the page. The whole admin menu drops below the wrap class I've put around the content.
For A) I'm thinking that I should tell the plugin to load only on its own page, but I don't know how. For B) My guess is that I should tell the plugin where to insert the content (using a hook?), but I don't know how either. This is my first attempt at building a plugin. I've read up on numerous websites on how to write plugins, but I just can't get it right.
The two PHP files:
- The main plugin file: verkoopstatus-admin.php (I left out the plugin template information part):
Pastebin verkoopstatus-admin.php
- The content part of the plugin: verkoopstatus.php
Can anyone tell me what I'm missing here?