Embed a view inside a node in Drupal 7
We can embed a view created by Views module inside a node in Drupal 7 with just some short code. Here is the code:
<?php
$view = views_get_view('your_view_name');
$view->set_display('your_view_display_name');
$output = $view->preview();
// now print the view.
if ($view->result) {
print views_embed_view('your_view_name', $display_id = 'your_view_display_name');
}
?>
Just put that in your node.tpl.php, and don't forget to change the views name and display name with yours.