I have embedded view in a node with following code:

 $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.

Comments

mustanggb’s picture

Status: Active » Fixed

Just use limits and/or filters, but easier and faster solution.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.