I used this code to get a pager.
if (isset($_GET['tid'])) {
$id=($_GET['tid']);
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
$query->entityCondition('bundle', 'escorts_product');
$query->pager(2,1);
$query->propertyCondition('status', 1);
$query->fieldCondition('field_product_sub_cat', 'tid', $id,'=');
$result = $query->execute();
//print "<pre>";print_r($result);
}
When I used print "<pre>";print_r($result)
, it gave me 2 results on y page, whereas I added more than 2; this is right.
How should I get links for next page and also previous, next? Is there any other way to get a pager?