implement preprocess function for particular view.

Public

Implement preprocess function for particular view in template.php of your theme. In this preprocess function you can alter that specific view.

Get raw version
php
  1. <?php
  2. // first implement hook_preprocess_views_view() which is called for each view.
  3. function THEMENAME_preprocess_views_view(&$vars) {
  4. if (isset($vars['view']->name)) {
  5. $function = 'THEMENAME_preprocess_views_view__'.$vars['view']->name;
  6. if (function_exists($function)) {
  7. $function($vars);
  8. }
  9. }
  10. }
  11.  
  12. function THEMENAME_preprocess_views_view__YOUR_VIEW_NAME(&$vars) {
  13. //alter here that specific view
  14. if($vars['display_id'] == 'page_1') {
  15. // here it will alter specific display of that view.
  16. }
  17. }