How can we set the items per page to a view, programatically?

How can we set the items per page to a view, programatically?

This is also a way to embed views programatically into your pages and nodes.
The following lines of code will load a view and print the display


$view = views_get_view('view_name');
$view->items_per_page = 6;
//To dynamically filter the view
$view = $view->preview('block', array(filter1 , filte2 , ....));
print $view;

Leave a comment