Skip to content

Instantly share code, notes, and snippets.

@johnmcc
Created January 17, 2013 15:01
Show Gist options
  • Save johnmcc/4556510 to your computer and use it in GitHub Desktop.
Save johnmcc/4556510 to your computer and use it in GitHub Desktop.
Embedding a view programmatically
<?php // view, display, any additional contextual filters ?>
<?php $view = views_embed_view("view_name", "display_name", $node->nid); ?>
<?php if(strpos($view, "view-content") !== FALSE){ ?>
<?php echo $view; ?>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment