Feb 142013
Sometimes you don’t want all those numbers on your pager. Or you don’t want the text ‘next’ etc. It is very easy to change those in a preprocess. This code changes the number of pages shown in the pager from the default down to 5, and changes the first, next, previous, last text to arrows.
function yourtheme_preprocess_pager(&$variables, $hook) { if ($variables['quantity'] > 5) $variables['quantity'] = 5; $variables['tags'][0] = '<<'; $variables['tags'][1] = '<'; $variables['tags'][3] = '>'; $variables['tags'][4] = '>>'; }
Add this to your theme’s template.php and replace ‘yourtheme’ with your theme’s name.
Great code. Worked like a charm.
Great post. Thanks a lot.
Thanks a lot – simple and efficient code!
Search for quite a while and found many over complicated solutions, and then found this simple bit of code… Nice work!
Thanks for this, man! Many sites are nothing but complicated with respect to pager theme override for Drupal 7.
Great Code Thankyou 🙂