Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am developing a plugin and need to generate a blank page (load the page.php from the current theme) and print custom content such as an HTML form or a message.

It should have a URL like http://example.com/?wpex_page=confirm

How can I display a page with the current theme's page.php and custom content in it?

EDIT (18 Jan 2012):

Found a better and simpler working solution: Generate a custom/fake/virtual Wordpress page on the fly

share|improve this question
1  
I find it a bit hard to undesttand your question, why would a PAGE.PHP clutter the wp_posts?? and second , what do you mean by make the plugin dependable on the WP installation ?? –  krembo99 Jan 5 '12 at 6:36
    
Sorry, I've removed all that. Question should be clearer now. –  XaviEsteve Jan 5 '12 at 10:26
1  
still not sure what you mean by "current theme " but you can always filter the content , or look at the page_template filter . –  krembo99 Jan 5 '12 at 11:30
add comment

1 Answer

up vote 0 down vote accepted

Adding and catching the query vars (wpex_page=confirm) is the simple part as explained in this answer but sine you want to use the theme's default page.php there is something extra you need to do and this is a nice tutorial which covers it.

share|improve this answer
    
Thanks Bainternet! A 'virtual' page is what I was looking for :) –  XaviEsteve Jan 5 '12 at 13:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.