Runing PHP Code inside region.tpl.php file I'm trying to create a dynamic site based on a static theme. I wonder to know why when I want to put my main menu in the region--page-top.tpl.php it does't work. this code 

&lt;?php print theme('links__system_main_menu',
                   array('links' =&gt; $main_menu, 
                            'attributes' =&gt; array( 'class' =&gt; array('links','inline'))));?&gt; 


works correctly inside the page.tpl.php but it seems that php code doesn't recognize in the region section. The HTML codes work fine, though.
I believe you cannot render main menu in this way within a region, the variable is not there. You could try with:

$main_menu_tree = menu_tree(variable_get("menu_main_links_source", "main-menu"));
print drupal_render($main_menu_tree);


Even better, I would recommend that you simply render the output of the particular region properly and add the menu dynamically from Blocks administration.

To render a region in your theme shortly, you need to define a proper region in your theme's .info file (eg. my_region) and render it using print render($page['my_region']); in the .tpl.php file. I hope this guide will help you: https://drupal.org/documentation/theme