0
votes

I am building a plugin for the first time and I have setup my rewrite rules to call a PHP file I have located in my plugin folder and this is working but all I have it output just now is "test"

I wanted to ask, is there is a way of pulling in the existing theme and using this as the basis for the page, then I can have my plugin just output the page content area so to speak.

My plugin is quite big in terms of the amount of data it handles so I would like to be able to use a menu link to the aforementioned file and this file can then output all the sub pages of content but still using the default theme (theme I have made) and fill the content area only is this possible and if so is there anything to explain this already available because I couldn't see it.

Any help with this would be much appreciated.

Edit: I have tried including a file from my current theme but this will give me a 500 error so I assume its not as simple as this.

1
Personally, I can't really see the picture without seeing the code. And if this is pure WP development, I'd consider posting at WordPress Development (but, please, don't cross-post). - brasofilo
Well essentially I have a plugin which lets the user put in property developments, house styles, maps, floors, plans, PDF's etc etc I made my own tables for these and this part is all done, now I could output pages using shortcode but that would mean making each page. So I have written a re-write rule to point to a file in my plugin folder, this is a bare PHP file at the moment just outputting "test" but is there a way I can pull wordpress theme files into this so I don't need to rebuilt my entire theme etc? - Sam

1 Answers

0
votes

Have you thought about using custom post types for your plugin content rather than relying on custom tables and separate code?

Other than that, you could use a shortcode (just one) and have users insert that into a regular WP page, the shortcode then displays all of your various plugin stuff.

It's hard to be more specific without understanding why you've done it this way.