Freaky Trigger’s WordPress Setup
Widget Logic
FT had a complex sidebar, but I decided to ‘widgetise’ it when Steve updated the theme in early 2008. To keep some of the special widgets appearing only when needed, I wrote a plugin to extend the functionality of widgets. Widget Logic allows widgets to appear or not depending on standard WP conditional tags, such as is_home() and is_single() and so on.
If you want to contact me about it you should address yourself to the WordPress org directory and perhaps post on the forum there. Or you can leave a comment here, below. PLEASE READ THE FAQ AND OTHER NOTES in the WordPress plugin directory first though.
If you find Widget Logic useful to you, then you could consider a small donation to Cancer Research UK – click ‘Donate’ on the widget over to the right there –>
VIDEO TUTORIAL! Popup or view on YouTube a screencast by Daryl Lozupone. Thanks to him.
Podcast Channels
Podcast Channels is a plugin that augments WP’s RSS feed with some extra elements, mostly in the ‘itunes’ namespace. It works with existing features of WP (auto-enclosures and the media library) to make a simple way to podcast, and allows different metadata in different RSS feeds – you can have as many channels as there are categories, tags, even blog authors.
Like a lot of people I found PodPress increasingly frustrating to use around WP2.6. I still see lots of people using it, but I found it was interfering with too many aspects of WP – wysiwyg editing, the media library, and so on. But there were only two things it did that I liked – show download stats, and allow multiple podcasts on a blog with their own rss and iTunes metadata. So i wrote a couple of plugins to target just those functions.
(I may release the stats plugin some day, but it’s nothing special, a bit clunky, and I really don’t want to support it.)
Freaky Trigger Theme
This was designed by Steve Mannion @ base58.com
Plugins FT uses
- Akismet by Automattic
- Cimy User Extra Fields by Marco Cimmino
- Contextual Related Posts by Ajay D'Souza
- Edit Comments by Andrew Sutherland
- FT Combo by Alan Trewartha
- Get Recent Comments by Krischan Jodies
- Google Custom Search Plugin by Aleem Bawany
- MediaElement.js - HTML5 Audio and Video by John Dyer
- More Fields by Henrik Melin, Kal Ström
- Organize Series by Darren Ethier
- Podcast Channels by Alan Trewartha
- Revision Control by Dion Hulse
- SABRE by Didier Lorphelin
- Widget Logic by Alan Trewartha
- WP-DBManager by Lester 'GaMerZ' Chan
- WP-Polls by Lester 'GaMerZ' Chan
- WP-Polls Widget by Lester 'GaMerZ' Chan
- WP-PostViews by Lester 'GaMerZ' Chan
- WP Google Analytics by Aaron D. Campbell
- WP No Category Base by iDope
wow, look at all of them. FT salutes you
admin in • 124,661 views

Hi,
great plug-in! Can you help me?
I try to hide the Categories Widget just from one page (id172)and show it on all other pages of the website.
What is the code?
Thanks !
look at the examples on http://wordpress.org/extend/plugins/widget-logic/other_notes/
I was wondering how to get a widget to appear on multiple pages by indicating which specific page id’s i want the widget to appear on. how is this done?
This is a great plug in :)
@ hershal
you could use PHP’s logical OR operators like this
is_page(‘about-me’) || is_page(’42′) || is_page(‘About Me And Joe’)
or if you read http://codex.wordpress.org/Conditional_Tags you’ll see you can do the slightly more PHP-savvy but simpler
is_page(array(42,’about-me’,'About Me And Joe’))
This is one of the most useful plugins installed on my blogs. :-D
I have just one question:
How can I exclude just one page and show the widget on all other pages (home, single, page)?
I have looked at the examples on the suggested WP site, but still don’t have a clue what code to add to the widget logic box.
Can you please help me out?
Greetz!
Mieke
add a ! on the front, which means NOT in PHP
!is_home()
etc. i will add this to the plugins FAQ on the wordpress plugins site
Alan,
Love the widget Logic plug-in. Quick question though. I have been having problems with the speed of my site. I want to blame the host, they want to blame my plug-ins (I did go crazy with plug-ins when I started building my site). Since my site is so dynamic, at least the sidebar, I really can’t use a cache, or at least I don’t know how to use it with my sidebar and your plug-in.
So 2 questions:
1. Do conditional tags slow down the page loading by making additional calls to the database, or are conditional tags just reading the data que from the last query?
2. Do you no of a way to be able to use your plug-in and WP Cache. WP Super Cache I don’t believe will help me since most of my users log in when they visit.
thanks.
1 – i don’t believe so, no. if you look in wp-includes/query.php you’ll see a lot of the conditional tags code there. and they all do fairly simple manipulations of already established query results. is_home for instance is just
global $wp_query; return $wp_query->is_home;
and so on
2 – the plugin doesn’t have any problem working with wp cache. unless you are using conditional tags that will produce different results over time.
This looks like a fantastic plugin, can’t wait to try it out. It looks a bit like Ozh who sees ads, but your plugin seems more easy to use.
Thanks a bunch.
Hi there, is there a way to make a text/html widget on my blog appear only to me (as an admin) or to (logged in users) using this plugin?
You can use the current_user_can(‘capability’) function, like this guy did:
http://wordpress.org/support/topic/179656?replies=5
Is this working on 2.7? I keep getting an error when I update anything site wide.
Warning: Cannot modify header information – headers already sent by (output started at /home/gvegason/public_html/krah/wp-content/themes/fresh-editorial/functions.php:15) in /home/gvegason/public_html/krah/wp-includes/pluggable.php on line 850
it’s working on my 2.7 install yes. what happens when you switch to the standard theme? as it looks like something in the functions.php of your “fresh-editorial” theme is where the problem starts
This is exactly what I was looking for, but am having some slight issues. If I do is_category(‘fun’) the widget shows up when visiting page http://mydomain/category/fun/ but doesn’t show up on post in the category with urls http://mydomain/fun/post1
Please help.
Thanks,
Eric
you want to use is_category for category pages and in_category for posts that are in specified categories
the pages at WP, specifically http://codex.wordpress.org/Conditional_Tags are very useful on points like this
Thanks for your reply! I should have done a little more research before asking.
Hi-Thanks for all the useful information and the plugin–Andy
Hi Alan,
I’m trying to get this to work with TTFTitles, but I keep getting errors. Since I’m still pretty much a n00b at php, could you help me out? I copied and pasted the codes (add_filter and the function) in my theme’s functions.php file, but I keep getting ‘unexpected’ errors. Here’s my code:
add_filter('the_ttftext', 'ttftext_widget_title', [priority], 2);function ttftext_widget_title($content='', $widget_id='')
{ preg_match("/]*>([^<]+)/",$content, $matches))
$heading=$matches[1];
$insert_img=the_ttftext( $heading, false );
$content=preg_replace("/(]*>)[^<]+/","$1$insert_img",$content,1);
return $content;
}
Thanks in advance :)
Oh never mind, I fixed it myself :) There seemed to be an error in the filter for ttftitles, here’s the fixed version:
function ttftext_widget_title($content='', $widget_id=''){ preg_match("/]*>([^<]+)/",$content, $matches);
$heading=$matches[1];
$insert_img=the_ttftext( $heading, false );
$content=preg_replace("/(]*>)[^<]+/","$1$insert_img",$content,1);
return $content;
}
$matches was closed with )) instead of );
One more thing though: what is meant with [priority]? I removed it to get rid of the “unexpected ‘]’” error.
oops! i hadn’t noticed that extra ) in the TTFcode before – it should be a semi-colon instead. (which is otherwise missing!)
[priority] is the optional parameter that you can give when you register with add_filter – it allows you to set order of filtering routines if needed.
http://codex.wordpress.org/Function_Reference/add_filter
thanks for pointing both these out – i will try to remember to update the official WP repository
Okay thanks! :)
This is such a great plugin. I thought I would have to code a whole new sidebar for every page other than my index page and this theme has solved my problems effortlessly. Your work on this plugin is greatly appreciated at ilapko.com. Thanks!
:-)
remember you can still define different sidebars to be invoked by different template files (home.php, single.php. etc)
I’m trying to figure out the right widget logic to use to display a widget only on a page or a sub-page of that page. I took a look at WP’s conditional tag information, and figured it is some variation upon
( is_page(‘title’) || $post->post_parent == ‘xx’ )
But nothing I try seems to work. Any tips?