daniels
daniels

Reputation: 19243

Wordpress plugin

I need to develop a plugin that will create a custom registration page. Can i create a page like /my-registration for example and when user gets there i will have my custom forms? In wp-admin i see that i can only create static pages, i don't see a way that i could create a page and then associate it with my plugin so that the content of that page will be generated by the plugin instead of using the editor to enter text.

Can this be done?

Upvotes: 0

Views: 158

Answers (2)

netchaos
netchaos

Reputation: 31

You can create custom templates for specific pages and can include all your custom codes in that template file. In your example create a file named my_registration.php and put the following at the top of that file,

<?php
/*
Template Name: My Registration
*/
?>

Now you have a template called My Registration. Then you need to create a new page from Wordpress admin and select this as the Template in the Page Attributes section.

Please refer to Wordpress manual for more details http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

Upvotes: 0

cbrandolino
cbrandolino

Reputation: 5883

It can be done and, if you just need it for one site, you won't even need a plugin. Here's how it works:

  1. Create a static page;
  2. Create an empty template file;
  3. On the page editor, assign your template to the new page;
  4. Forget about the page, you'll just use it for the routing;
  5. The template file is now like any other php file. Implement your registration page there, include any other file containing the logic.

This is not elegant, obviously - but then again, if /code is poetry/, it might be considered a DADA work. Uh, all of a sudden I came to a deep understanding of the principles underlying Wordpress!

Upvotes: 1

Related Questions