‘nid’ is the field used in my view for filter and following is my code for give a value to filter
$BlogSelected contains blog id showed as first blog,the view shows rest of the blog items

$view = views_get_view(“View_Blog_User_Archivio”);
$display_id = ‘default’;
$view->set_display($display_id);
$item = $view->get_item($display_id, ‘filter’, ‘nid’);
$item[‘value’] = $BlogSelected;
$view->set_item($display_id, ‘filter’, ‘nid’, $item);
$view->is_cacheable = FALSE;

$view->execute();

$output = $view->render();

Advertisements