print all the titles of a content type by php
I think the "best" way (most future-proof etc.) would be to use an EntityFieldQuery:

$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'node')
  -&gt;entityCondition('bundle', 'period');

$results = $query-&gt;execute();
if (!empty($results['node'])) {
  $nodes = node_load_multiple(array_keys($results['node']));
  foreach ($nodes as $node) {
    // Do something with $node-&gt;title
  }
}


There are other options but they either involve deprecated methods or going directly into the node/revision tables, which can be a pain.

If you need this list in page.tpl.php make sure you don't put the code directly in the template file (it's bad practice and can cause problems with caching). The best place would be in a preprocess hook in your theme's template.php file, or a module file.