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,724 views

Thank You soo much for making this plugin
I needed soemthing like this real bad.
Keep up the good work dude.
P.S. something you may want to add to this plugin
would be an option where what users input into the box will not be what posts/pages you want the widget to show up on but what posts/pages you don’t want the widget to show up on this way I will not have to input soo much.
just a thought :)
you can do that already using the logical NOT exclamation mark. read the notes here on ‘building your own’ code http://wordpress.org/extend/plugins/widget-logic/other_notes/
I am trying to use this plugin to get ttftitles plugin to work in my sidebar. Which I did get to work, but when activated, I lose all of my page code past my sidebar. In my case the footer. If I turn off the WL plugin or delete the function for ttftitles, for the footer returns.
Any Ideas?
Thanks in advance.
sounds like your widget_content filter function is throwing an error. what’s your code? have you adapted it from my code given on
http://wordpress.org/extend/plugins/widget-logic/other_notes/ ?
to check that, change the filter function to return $content untouched.
Hi guys!
THANKS so much for this widget! And I already have a question. The client wants a specific page to be his opening page for his site. The page in the menu is called “Home”. When I go to the Pages>Edit section of the Dashboard, there is no page name showing in the path for me to put in the is_page() code.
The path to this page (on the mockup of this site) is just http://bestbiztips.com/quickmedquote – and I tried putting ‘index’ in the code with no success.
How do you suggest I code Widget Logic for specific widgets to appear on this page?
Thanks bunches!
I’ve been wondering for a long time now, but can widgets be placed only on a specific page? I’m thinking it’s impossible with the way blogs work.
kippiper, what you want is the condition for the front page, take a look at
http://codex.wordpress.org/Conditional_Tags#The_Main_Page
at the differences between is_home and is_front_page. this is asked a lot and IS in the main faq http://wordpress.org/extend/plugins/widget-logic/faq/
more generically if anyone else is looking for how to get widgets on specific wordpress PAGEs, take a look http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page
you can use the numerical ID, URL slug, or title of a page. the URL slug is simple enough to find, the ID you can get from clicking to edit the page and looking in the URL for post=xxx
Hi Admin -
Thanks so much for taking the time to graciously answer my silly question. I had looked in the FAQ and obviously was not “cluing in” on the terminology for the answer.
However, I am still having issues. My Settings>Reading is set to have “Front Page Displays” as the static page “Home”. However, when I code in Widget Logic is_front_page(‘Home’), the widget still does not appear.
Am I missing something?
Thanks!
I GOT IT! Thanks soooooooo much!
Widget Logic is great!
question:
How do I check, within sidebar.php if widgets are active for that page? I have div tags wrapping the widgets to create a right column. However, I need to hide those divs if no widgets are appearing on a page. Hope this makes sense.
Thanks for your help.
hmm. i’m not sure what’s your best bet
i was thinking of adding a “widget count so far” global, but that would only be useful AFTER the sidebar has been printed, which would (at bare minimum) include the open DIV or UL tag for your sidebar.
could you use CSS to add “display:none” for that bit of the page under the right conditions? if so, the “widget count so far” would be useful to identify that condition of course, and i’ll add it in to the code.
I think you’d have to add the STYLE section in the footer – i don’t think it would work within the sidebar would it? so that would be something you’d add to your own footer.php template i think
I’m having some trouble getting the plugin to help me change the titles of my sidebar widgets using the ttftitles plugin. I activated the ‘widget_content’ filter then grabbed this code from the ‘other notes’ section of the plugin homepage and put it in my functions.php file:
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;
}
Am I missing a step? Do I need to add any code to the 'Widget logic' section of the widgets dashboard?
I expect you haven’t used add_filter to connect your function to the filter. Look again at the ‘other notes’ section
I have split my blog into two categories, “blog” and “news”, and display each on a separate page. What would the array syntax be for pages website.com/category/blog/ and website.com/category/news/ ?
Thanks for the plugin!
I have one question.
What code would I put for a widget to appear just on 1 page? the “is” code excludes the page I add.
Hello,
Just discovered this plugin! Will be donating soon for sure :)
I’ve looked here:
http://wordpress.org/extend/plugins/widget-logic/other_notes/
and here:
http://wordpress.org/support/topic/207694
How do I get a widget to show ONLY on a page that is a subpage of a parent page.
This looks close but does not work:
global $post; return (in_array(77,get_post_ancestors($post))); — WP page that is a child of page 77
Thank you very much in advance for your help.
That code will work to find pages that are subpages of the page with ID 77. what are you after – pages that are subpages of any page?
Thank you for plugin, will this work on latest wordpress..
I’ve got it figured out. I had super cache on and it was not showing correctly. The code that worked is pretty simple: is_page(’141′)
Thanks Alan. P.S. Just made a small contribution to the Cancer Research UK on your behalf. Thanks for a very useful plugin!
Mr Freaky Trigger,
I am glad you enjoyed the Video Tutorial I put together. I sincerely appreciate you linking to it here on your site
Thanks serenine and to anyone donating to Widget Logic’s Cancer Research UK drive.
And thanks too to you Daryl for taking the time to make the video.
Hi, I really love this plugin but I keep running into errors whenever I do conditional statements other than the simple statements. When I add the conditional: !(is_single(’798′)
I get this error:
wp-content/plugins/widget-logic/widget_logic.php(154) : eval()’d code on line 1
I can’t get it to work on any of the conditional statments other than the basic true value statements. Not even statements like is_single(array(17, 19, 1, 11)) will work for me. I tried switching to the default wordpress theme and it still will not work.
Any suggestions?
EDITED: I figured out the first error, lol. I am ashamed I did, but I still have problems with complex strings; they give error outputs. I’ll have to copy them later to show though. Sorry. GREAT PLUGIN
i tried installing it for almost two days and i’m happy now.it worked.thanks for the plugin- no questions.Perfect!
Thank you so much for the video and explanation. My question is that there is a particular page on which I do NOT want the widget to appear, but I want it to appear on all others. How do I do that?
Hi. I’m really sorry to be commenting here as this has to do with your relocate/upload plugin, but, I can’t for the life of me find anywhere to contact you about this anywhere else. There was a user who had the exact same issue as I am having in the comments at the repository, the filter for viewing the files from the RU folder in media library not working, and it was solved with the changes that you guys made to v.014, but, this has not worked for me and I am having a devil of a time figuring out what is causing this not to work in my instance.
General Settings in WP are: http://domainname.com/wpdirectory
RU settings are:
root: hostdirectory/homepages/hostdirectory/hostdirectory/htdocs/wpdirectory
default: /homepages/hostdirectory/hostdirectory/htdocs/wpdirectory/wp-content/uploads
I can upload to my RU created folders, and the files are then listed in the media library ( however the image does not show up ) but, I cannot get anything to show when I use the pull down menu to list only images in that folder. As well, if I try to move something back OUT of that folder and into the default location, I get a warning from the rename function that the file or directory does not exist ( line 51 of relocate-upload.php ) along with “cannot modify header info” errors from lines 72 and 73. I’m on WP 2.8.6. Do you have any idea why this might be occurring? The host I’m on is 1and1. Do you think it may have something to do with how they name the root folder? I’m really baffled and very much need this ability. I think this is a great plugin that you have written here, and would love to get it working properly. Any help would be greatly greatly appreciated ;-)
By the way, I tried to register a few times for your site and each time got a “fake user” response. I’m real, I promise.