GetSimple Support Forum
Writing php in page - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Writing php in page (/showthread.php?tid=6625)



Writing php in page - emax - 2014-08-08

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


RE: Writing php in page - Carlos - 2014-08-08

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)