I could print the view with this code in page.tpl.php.

print $view->display['view_display_name']->display_options['title'];

How can I print the Views title ?

3 Answers 3


You can aptly use this function views_embed_view(). This will help you to print out the view, passing arguments.


If I correctly understand your question, you are actually looking for how to define $view. That can easily be done with views_get_view(). Add <?php $view=views_get_view('YOUR-VIEW'); ?> to page.tpl.php or predefine the variable with template_preprocess_page() in your theme's template.php file. You can then print the View's title with your code line.


Add the following code in your template.php

function themename_preprocess_page(&$variables) {
  $name = 'view_machine_name';
  $display_id = 'block_1';
  $view = views_get_view($name);
  if(isset($view) && !empty($view)) {
    $head_title = $view->get_title();
    $variables['view_title'] = $head_title;

add the following variable anywhere in the page.tpl.php file used by your theme.

 print $view_title; 

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.