Print User Registration Block Through template.php file I just want to print the user registration block through my template.php file without using the Form Block or Enabling php on my site to use this code: 

&lt;?php

if(user_is_anonymous()) {  
  $form = drupal_get_form('user_register_form');
  print drupal_render($form);
}

?&gt;


I have tried the following:

function my_template_form_alter {

      $form = drupal_get_form('user_register_form');
      print drupal_render($form);
}


I want this block to appear on my blocks administration page just like the user login block, so I can place it anywhere I like. Any help as per how to achieve this? Thanks
You won't need any alters. Just go to the template in which you want to place the registration form and add,

$form = drupal_get_form('user_register_form');
print drupal_render($form);


This will print the user registration form. It's always good to have a check for anonymous users as a wrapper of this output.

Edit #1 (After question update and comments)
I suppose you want to create a block that will appear in your "admin/structure/block" page and you can assign the block in any desired region? - Right? I don't think your question says the same but this can be done in the following way,


Create a hook_block_info() &amp; hook_block_view()
In the hook_block_view() assign the "content" the following,



$form = drupal_get_form('user_register_form');
$block['content'] = drupal_render($form);


I hope this can solve your problem. I haven't tested this yet!