Q:

How to add "#main-content" to the link of pager element?

I would like to add #main-content to the link of pager element. So, I would get an url like this: http://domain.com/my-views-list?page=2#main-content
Any idea, are there any preprocesses or something like that?

A:

You can use template_preprocess_pager to alter the pager links. You should be able to do something like the following for whatever links within the pager you want to change:
function MYTHEME_preprocess_pager(&$variables) {
  if (some check to make sure its the pager you want){ 
    $cur = $variables['items']['next']['href'];
    $variables['items']['next']['href'] =  $cur . '#main-content';
  }
}

