From 34483fbd590d07f24dc92bf6fff6144e77e6b4d5 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Mon, 27 Oct 2003 23:00:39 +0000 Subject: [PATCH] If there is one hit on a search redirect to that post's permalink. git-svn-id: http://svn.automattic.com/wordpress/trunk@493 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- blog.header.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blog.header.php b/blog.header.php index 7bbed6060c..93b9958866 100644 --- a/blog.header.php +++ b/blog.header.php @@ -307,5 +307,8 @@ $posts = $wpdb->get_results($request); if (1 == count($posts)) { $more = 1; $c = 1; $single = 1; + if ($s) { // If they were doing a search and got one result + header('Location: ' . get_permalink($posts[0]->ID)); + } } ?> \ No newline at end of file