How do I add a pager for the following code? On the page--product.tpl.php I use node_load() to get all the nodes of a content type. I want to shows 15 post titles per page. How do I add a pager to the page?

I am using the following code.

$terms = taxonomy_get_children(arg(2));
foreach ($terms as $term) {
  $whole = taxonomy_select_nodes($term-&gt;tid, TRUE, 1, array('t.created' =&gt; 'DESC'));
  foreach ($whole as $nid) {
    $node_this = node_load($nid);            
    echo '&lt;h1 class="pdtitle"&gt;&lt;a href="#"&gt;'.$node_this-&gt;title.'&lt;/a&gt;&lt;/h1&gt;';
  }
}
I think you are trying to do a custom pager, not based on db query something like this, but it is D6 code.
For D7, check Extenders and what the Database Abstraction Layer page describes is


  Most Drupal database SELECT queries are performed by a call to
  db_query() or db_query_range(). Module authors should also consider
  using the PagerDefault Extender for queries that return results that
  need to be presented on multiple pages


You may also need to check theme_pager which displays the pager result.
When calling theme('pager') outside a pager query, it's necessary to initialize the pager first with a call to pager_default_initialize.