Show exposed form views in any place

Public

This snippet may used in any place of your site. Block, page, node ... Anywhere.

Get raw version
php
  1. <?php
  2. $view = views_get_view('search'); // search - name of view
  3. $view->set_display('page'); // page - name of display
  4. $view->init_handlers();
  5. $exposed_form = $view->display_handler->get_plugin('exposed_form');
  6. print $exposed_form->render_exposed_form(TRUE);
  7. ?>