Embedding Views / displaying Views programatically


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $view = views_get_view($view_name);
  2. $display_id = 'page_1'; // Can be feed_1 or block_1
  3. $view->set_display($display_id);
  4. $view->preview = TRUE;
  5. $view->pre_execute(array()); //args
  6. $view->is_cacheable = FALSE;
  7. $data = $view->render($display_id); // render
  8. return $data;

URL: http://www.jayboodhun.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.