Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Created September 1, 2016 15:33
Show Gist options
  • Save propertyhive/338878e74fc9b18ef7b6ec43c1bf4106 to your computer and use it in GitHub Desktop.
Save propertyhive/338878e74fc9b18ef7b6ec43c1bf4106 to your computer and use it in GitHub Desktop.
add_action( 'template_redirect', 'default_search_form_to_lettings' );
function default_search_form_to_lettings()
{
global $post;
if ($post->ID == 2) // REPLACE '2' WITH THE PAGE ID OF YOUR LETTINGS PAGE
{
$_GET['department'] = 'residential-lettings';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment