I have HTML desing of pagger ,How to I assign my own class to pager in side view ?I dont have any idea about it so will you plese tell how can I ?


2 Answers 2


I believe there are two ways you can do it:-

  1. In template.php , you can use theme_pager. Then overrite it.

  2. You can make a views template and overrite it. For this just goto advance option in views and search for template suggestion.


I could not find a way to add a class to theme_pager() using the hook_preprocess_HOOK system, so here is a slightly different template.php solution that won't involve having to override a core function.

I noticed that views pagers are also run through theme_item_list() which does allow you to add classes.

function MYTHEME_preprocess_item_list(&$vars) {
  $vars['attributes']['class'][] = 'my-class';

You can/should add an if condition check to see that the list really is going to be a pager, e.g. use if ($vars['attributes']['class'][0] == 'pager') or some other identifier to confirm that you're adding the class to a pager ul.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.