Add a views exposed filter block into my theme using template.php I would like to render a views exposed filter block in my node theme. This is what I am doing:

function MYTHEME_preprocess_node(&amp;$vars) {
   $search_form = drupal_get_form('views_exposed_form');
   $search_box = drupal_render($search_form);
   $vars['search_box'] = $search_box;
}


This way I could simply add variable $search_box into my theme and the filter block would be displayed.

I have confirmed and 'views_exposed_form' is the correct form_id. The problem is that this is throwing a nasty error that doesn't log the error message. My template gets broken (still appears, but broken) and no error message is logged.

It does work if I try to display, let's say, a regular search box. The code is the same, all I have to do is change to the search block form id (search_form) like this:

$search_form = drupal_get_form('search_form');


Right now, I am almost pulling my hair, have searched up and down the web. Any help is appreciated. Thank you!
You're actually having an error if you check the php logs:

PHP Fatal error:  Call to a member function get_exposed_input() on a non-object in   
.../sites/all/modules/views/views.module on line 1950


You can't just call drupal_get_form('views_exposed_form') because drupal wouldn't know which exposed form you want to render. Remember that a view or view display have its own exposed form.

If you check where the error is, you'll see that it's caused by not having a view object in the form_state variable.

What I suggest you do is use the Admin Block UI (/admin/structure/block) and just restrict which node types where you want to display the exposed filter.