/* Plugin Name: Feed List Plugin URI: http://rawlinson.us/blog/articles/feedlist-plugin/ Description: Displays any ATOM or RSS feed in your blog. Author: Bill Rawlinson Author URI: http://blog.rawlinson.us/ Version: 2.2 */ // include files $relroot = dirname(__FILE__).'/../../'; // get the magpie libary if (file_exists($relroot . 'wp-includes/rss.php')) { require_once($relroot . 'wp-includes/rss.php'); } else if(file_exists($relroot . 'wp-includes/rss-functions.php')){ require_once($relroot . 'wp-includes/rss-functions.php'); } else { function FeedListInitError(){ ?>
');
print_r($val);
print('');
}
/* end utility functions */
}
function rssLinkListFilter($text)
{
return preg_replace_callback("//", "feedListFilter", $text);
}
/* Templates can call any of these functions */
function rssLinkList($args){
if(!is_array($args)){
$args = func_get_args();
}
return feedList($args);
}
function feedList($args){
if(!is_array($args)){
$args = func_get_args();
}
$feed = new FeedList($args);
return $feed->FeedListFeed();
}
function randomFeedList($args){
if(!is_array($args)){
$this->args = parse_str($args,$a);
$this->args = $a;
}
$feed = new FeedList($args);
return $feed->FeedListFile();
}
function feedListFilter($args){
$args = explode(",",$args[1]);
if(count($args) == 1 && !strpos($args[0],":=")){
$a = array();
$a["rss_feed_url"] = $args[0];
$args = $a;
} else {
$a = array();
foreach($args as $arg){
$arg = explode(":=",$arg);
$a[$arg[0]] = $arg[1];
}
$args = $a;
}
$feed = new FeedList($args);
return $feed->FeedListFilter();
}
/* end template functions */
if (function_exists('add_filter'))
{
add_filter('the_content', 'rssLinkListFilter');
}
if(function_exists('FeedListInitError')){
add_action('admin_head','FeedListInitError');
}
?>
$theTitle=wp_title(" - ", false);
if($theTitle != "") {
?>
30 Sep // php the_time('Y') ?>
This is how I do it.
1. Just take your standard page template (page.php) and save it as a new file coop search results. (coopsearchresults.php)
2. Then add this in the very first line before
<?php
/*
Template Name: Google Coop Search Results
*/
?>
3. Right below the end of the first loop you need to add the google coop results code.
eg
<?php endwhile; ?>
<?php endif; ?>
**** Add Google Coop Code Here ****
Make sure you change the width of the results frame so it will work in your template. I think it defaults to 700 wide or something like that. You might have to change it to 500 if your content area is say 550px.
Upload this template to your themes folder.
4. Now create a new page in your wordpress admin and call it ‘Search Results’ on the right hand side where it says page templates select your new template ‘googlecoopresults.php’ then click save.
5. Now in Google Coop there is an option where you can select show results in your own site which is the second option in the Code area. Select that option and where it says search results page add this line:
http://yourdomainname.com/search-results/
6. Select the search form code and copy and paste it into your searchform.php template.
7. If you haven’t already done so copy and paste your Google Coop Search Results code as outlined in step 3 into your new coopsearchresults.php template.
Leave a reply