Add content to view header, footer, before or after using hook_views_pre_render() in Drupal 7. Using hook_views_pre_render gives you the opportunity to use values from executed views query.
Source code viewer
/** * Implements hook_views_pre_render(). */ function HOOK_views_pre_render(&$view) { if ($view->name === 'my_view') { $content = 'This content will appear before header section of your view.'; $view->attachment_before = $content; $view->attachment_after = $content; } } Programming Language: PHP