how to create the pagination for customized portfolio template I will create the portfolio gallery page using custom content types with thumbnail and bigimage  image fields. then i am using the following code for rendering content types

&lt;?php 
$content_type = 'websiteportfolio';
$query = new EntityFieldQuery();

$entities = $query-&gt;entityCondition('entity_type', 'node')
-&gt;entityCondition('bundle', $content_type)
-&gt;propertyCondition('status', 1)
-&gt;pager(9)
-&gt;execute();
$nodes = entity_load('node', array_keys($entities['node']));?&gt;


&lt;?php
  $i = 1;
  foreach($nodes as $val=&gt;$key1)

  {

 ?&gt;


 &lt;div class="thumbnail-box"&gt;
&lt;a href=&lt;?='sites/default/files/'. $key1-&gt;field_bigimage['und']['0']['filename']; ?&gt; rel="lightbox[portfolio]"  title="&lt;?= 'Portfolio'.$i ?&gt;"&gt;&lt;img src=&lt;?='sites/default/files/websiteportfolio/'. $key1-&gt;field_images['und']['0']['filename']; ?&gt; alt="&lt;?= 'Portfolio'.$i ?&gt;" /&gt;&lt;/a&gt;

&lt;/div&gt;

 &lt;?php 
$i++;
}


 ?&gt;


finally i got the 9  thumbnail images in my page and also light box functionality working well.My issue Only show first 9 images I need pagination for showing the remaining images how  can fix this issue..
First things first, that code shouldn't be in the template file; it should be in a preprocess function. The reasons for this have been documented at great length both on this site and the internet in general so I won't go into them here.

You might also find the l() function interesting, as well as theme_image()...API replacements for the custom HTML you're building up.

Other than that, the only thing you're missing is the code to actually render the pager; that would entail adding this to your preprocess function, after the query has been run:

$vars['pager'] = theme('pager');


And in the template file simply outputting it wherever you'd like it:

&lt;?php echo $pager; ?&gt;