Skip to content

Instantly share code, notes, and snippets.

@henrytran9x
Last active August 29, 2015 14:17
Show Gist options
  • Save henrytran9x/1684f8f609e8dd143961 to your computer and use it in GitHub Desktop.
Save henrytran9x/1684f8f609e8dd143961 to your computer and use it in GitHub Desktop.
Programmatically render views in Drupal 7
<?php
print views_embed_view('VIEWS_MACHINE_NAME', 'DISPLAY_ID', $view_arg);
$view = views_get_view('VIEWS_MACHINE_NAME');
$view->set_display('DISPLAY_ID');
print $view->get_title();
print $view->preview('DISPLAY_ID');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment