2010-03-09 128 views
0

我有什麼: 谷歌搜索的形式(在所有網頁上顯示) 一個WordPress頁面來顯示搜索結果頁面重定向在WordPress

我想做的事: 當執行搜索時,重定向到包含搜索結果的頁面

我該怎麼做?

搜索結果頁面是一個固定鏈接一個WordPress創建的頁面domain.com/search-results

+0

爲什麼你不使用WordPress的本地搜索或谷歌搜索插件? http://google.com/search?q=wordpress+google+search+plugin你在做什麼是一些有點weaired! – sepehr 2010-03-09 13:47:20

回答

1

,如果你的模板文件沒有一個名爲「search.php中」,然後創建一個, 這是所有的結果將顯示,做一個標準的WP循環和樣式它.. 多數民衆贊成如果您使用標準的WP搜索,在這種情況下

應用模板標籤到新的php頁面的頂部,

<?php 
/* 
Template Name: Search_Results 
*/ 
?> 
<?php get_header(); ?> 
or include a new one 
<?php include(TEMPLATEPATH . '/header_search.php'); ?> 

<!-- INCLUDE GOOGLE SCRIPT --> 

<?php get_sidebar();?> 
<?php get_footer();?> 

這應該打印出你的結果...