I have embedded view in a node with following code:
<?php
$view = views_get_view('articles');
$view->set_items_per_page(1);
$view->set_offset(2);
print $view->preview('page');
$view->destroy();
?>
I just need to display only one specific row (that's why I'm using offset). I couldn't find a way to retrieve one specific row with any other method.
This code is acceptable but it has pager because that view has more than one row. Is there a way to remove pager like in Views UI? In Views there is a option to not use a pager but "Display a specified number of items".
I would like to remove it completely from code without CSS.
offset_2
for descriptive purposes) that doesn't have a pager in it, eg, selectingDisplay a specified number of items
instead ofPaged Output
and then calling that in yourprint $view->preview('offset_2');
$pager
so if you can figure out a way to target this instantiation of the view, you could just comment it out there.