Create views programmatically


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



Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. $view_args = array();
  4. $display_id = 'page_1';
  5. $view = views_get_view('view_name');
  6.  
  7. //avoid error if view is not created yet !
  8. if ($view && !empty($view)) {
  9. print $view->execute_display($display_id , $view_args);
  10. }
  11. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.