Manually execute a view, the right way


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

If `views_embed_view()` or just `$view->execute()` are called, the default view settings are used (only shows 10 entries, etc.) so we have to call `$view->set_display()` & `$view->pre_execute()`.


Copy this code and paste it in your HTML
  1. $view = views_get_view('links');
  2. $view->set_display('default');
  3. $view->pre_execute();
  4. $view->execute();

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.