GetSimple Support Forum

Full Version: Writing php in page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I would like to add the registration form in a page.

(the one from this link)

I tried to add the script
<?php user_login_register(); ?>

in a page but it gets converted as a comment so it is not shown.
I know there are plugins that allow me to write php code in a page but if it is not allowed I think there is a good reason. So, is there a safe way to add the register form in a page ?
I don't want to add it in the template.php but in a page.

I'm not very good in php.
Emanuele
3 possible ways:

- With the DynPages plugin: you can put that code in a component (e.g. my-component), then insert this in your prefered page's content:
Code:
{% my-component %}

- Secondary template: You can make a copy of template.php in your theme's folder (e.g. template-login.php), insert the code in this new template, and then select it in your prefered page (options -> template)

- With a conditional: you can insert a code like this in your template.php
Code:
<?php
if (return_page_slug()=='pageid') {
    user_login_register();
}
?>
(change pageid to your prefered page's slug/id)