views:

30

answers:

1

This is probably a Wordpress issue more than a Friendfeed issue but could be either. I have tried to debug with Firebug, wP_DEBUG, and error_log() but no issues have appeared.

I'm trying to initalize a set of ajax-powered feeds (using Friendfeed API) in the middle sidebar on various Wordpress category pages using a conditional statement. I can get one feed to display on one page no problem but when I add the conditional, it no longer displays.

Relevant lines:

function farmball_feed() {
    global $post;
     if ( is_category('3')) { $category = "farmball";
     } elseif ( is_category('4')) { $category = "new-redsox";
     } else { $category = "red-sox-on-farmball"; }

     $feed = $friendfeed->fetch_room_feed($category, null, 0+($ind*30), 30);

Here is the full plugin code: http://www.pastie.org/private/vja7eisby93e3odh628xg

I call the function within the plugin using the following line in the sidebar-[category].php template file:

<?php if (function_exists('farmball_feed')) { farmball_feed(); } ?>

Here is the full sidebar code: http://pastie.org/private/lgxsdwxja08v93pkmvz3ug

I've checked in with the WP.org forum, MIRC, WP Tavern forum, and Friendfeed forum but no solution yet. I looked into the Developing a Widget codex but this plugin uses a couple other JS files so I don't think making it a custom widget would work. I'm not great with PHP so the answer could be a simple one. Appreciate the help.

Demo site: http://farmball.com/boston

A: 

It turned out to be an issue with where the JS plugin was being initialized. We had to add a line of php code to the friendfeed file which linked to the sidebar php code. Instead of using a conditional, we created unique sidebar template files, each calling js on its own. No conditional needed.

Adam