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

wow, look at all of them. FT salutes you


in • 124,654 views

Comments All, 1–25, 26–50, 51–75, 76–100, 101–125, 126–150, 151–175, 176–200, 201–225, 226–250, 251–275, 276–300, 301–325, 326–350, 351–375, 376–400, 401–425, 426–469.

  1. Markus on 9 December 2010 #

    I’m trying to write some conditional statements and I’m having trouble combining statements. Do you have examples of combining statements???

  2. Nimaro on 28 December 2010 #

    Hy there,
    this is a great plugin to easy manage the widgets on my website.

    But im aving problems to put 1 widget happering in the categorys…
    home(), pages(), is_single() works just fine… but when i try to put on category it dosent hapear anything. And i dont knwo where the problem may be.
    Can u help finding the problem here?
    thx

  3. Alan on 28 December 2010 #

    what logic are you using to identify a category?

  4. S.Wright on 9 January 2011 #

    Good day and happy new year!

    I too am delighted with your widget-logic plug-in, and it is working very well allowing me to display social icons only on defined pages. But, I am also trying to restrict a series of RSS feeds to a single page.

    I am in WP 3.0.4, and I CAN display more than one feed in a page through the WP base framework–I am NOT using an additional RSS plugin or widget plug-in,– but I cannot get widget-logic to restrict those feeds to a dedicated page. Is there something “extra” I must do, or is there something inherently conflicting between feeds and the plug-in? I am using the conditional is_page(‘Name of Page I Want the Widget On’)

    Your consideration is much appreciated. Thank you and best wishes!
    S.W.

  5. S.Wright on 9 January 2011 #

    PS to RSS Q:

    By the way, I wish to come back and say that I CAN restrict the feeds to the homepage using is_home(). But, I want to restrict the feeds to another page. I have tried writing the page name in the conditional to be case sensitive as they are written in the navigation menu, to be all lower case, and to place dashes between each word in the title. None work. Am I missing something? Thank you, again! / S.W.

  6. S.Wright on 9 January 2011 #

    Sigh…sorry to clutter your board! I have just found that the plug-in also will not work with a simple text field in that widget area. Could there be something wrong with the widget code itself or its interaction with the plugin? I have no idea how to check for this or even what to do if I found a problem. I am so sorry for the hassle. I hope you are still checking this board! Cheers!

  7. vehicle registration search on 10 January 2011 #

    Hi there! I’m at work surfing around your blog from my new iphone! Just wanted to say I love reading your blog and look forward to all your posts! Keep up the great work!

  8. Jeff Carter on 20 January 2011 #

    I get how to use Widget Logic to allow widget to conditionally *appear* on specific pages, but what conditional tags exist to *suppress* a widget from appearing on specific pages? For example, I want a widget to appear on every page except for, say, the “About” page. What is the conditional tag to suppress a widget from displaying on only that one page?

    Thanks.

  9. Jeff Carter on 20 January 2011 #

    After thought to my initial post…

    Right now I’m thinking the workaround is to use an array with is_page() to include all the pages (except the one(s)) that I want the widget to appear on. Please tell me there’s a better solution. ;-)

  10. Jeff Carter on 20 January 2011 #

    I figured it out the solution to my original inquiry:


    ! (is_page('about'))

    Thanks!

  11. Jeff Carter on 21 January 2011 #

    Oh, geeeeeeze! I was just at the Widget Logic plugin site on WordPress and saw the examples. Turns out the solution is even slightly simpler than what I posted.

    !is_page('about')

    The ironic thing is that the example is the same example I inquired about. LOL! :-)

    =Jeff

  12. Tomas Kapler on 25 January 2011 #

    Not sure if someone allready has reported but when wp-debug is set to true

    Notice: Undefined index: callback_wl_redirect in /httpdocs/wp-content/plugins/widget-logic/widget_logic.php on line 137 appears manytimes

  13. admin on 31 January 2011 #

    100k downloads from WP.org, and 250 quid raised for charity.

    i really must put in all those little tweaks and improvements suggested in the comments above – for which many thanks everyone.

  14. Lloyd on 1 February 2011 #

    I have no problems using single words example: in_category(Education) , but when I try using Health & Fitness, in_category(Health & Fitness), it doesn’t show-up in my side bar.

    Any clue?

    Thanks

    Lloyd

  15. admin on 1 February 2011 #

    http://codex.wordpress.org/Template_Tags/in_category seems to think that should be fine (so long as you are putting in the quotes). to troubleshoot you could try putting in

    print_r( wp_get_object_terms( $id, ‘category’))

    in your code, where $id is any post ID in the category you are having problems with. This will print an array of varying IDs and strings that you can use to match that post with in_category(X).

  16. Lloyd on 2 February 2011 #

    Thanks so much for your response, I made a simple change and it worked:

    Health & Fitness

    to

    Health-Fitness

    Thanks

    Lloyd

  17. geris on 8 February 2011 #

    Hello to all, i’m looking for a solution on my website http://www.lovingragusatravel.com

    As you can see, my home page redirect on two different section of the website, translated with ZDMultilang plugin
    http://www.lovingragusatravel.com/it and http://www.lovingragusatravel.com/en
    (i’m translating in this days)

    What i’m looking for is a conditional tag that select the widgets for each language, showing respectively the italian widget when user navigate through the italian section, and the respective for english.
    I can’t use categories or IDpage beacuse ZDM plugin maintain the same Id page and only add “en” or “it” after the home page URL
    Some workaround for this?
    Thank’s for your help.
    geris

  18. Alan on 8 February 2011 #

    i don’t know that plugin well, but the FAQ implies you can get the locale code with the function zd_multilang_get_locale()

    so try zd_multilang_get_locale()==’it’

    etc

  19. Black Cab Knowledge on 9 February 2011 #

    One of the better plugins, thanks.
    Just spent the best part of 6 hours looking through a load of widgets, switching widget-logic on and off, to discover a rogue – instead of _ and a mispelled !is_archives() instead of !is_archive()

    the background colours of the theme (this-just-in) had disappeared, very strange anyway i digress cheers

  20. hstilo on 16 February 2011 #

    Hello,
    I have activated the Widget Logic AND TTF Title plugins in the hopes of replacing widget titles with images.
    I’ve been at it for days but just can’t seem to get it no matter what snippet I try (or where I try to put it).

    I am using the 2010 Weaver theme.
    http://www.homestilo.com is the site.

    ANY help/insight would be much appreciated!!

  21. Alan on 16 February 2011 #

    Have you put the example code on http://wordpress.org/extend/plugins/widget-logic/other_notes/ in your theme’s functions.php file?

  22. hstilo on 17 February 2011 #

    Hi Alan,
    I have tried that. I have activated the ‘widget_content’ filter. I have also tried activating the ‘wp_reset_query’ fix.

    I have tried putting the example code into the functions.php file, also a 2010functions.php file that is there AND a section that the theme has for pasting snippets.

    The theme is a child theme of Twenty Ten.I thought that may be a reason why it isn’t working. So I tried activating Twenty Ten and placing into that functions.php file. Nada. I’m stumped.

  23. admin on 17 February 2011 #

    the wp_reset_query option is not relevant here – so forget that.

    the add_filter line and ttftext_widget_title function need putting in just once in the theme’s functions.php file – if you have it multiple times you will probablt end up with errors.

    troubleshooting steps you could try that I can think of.

    first check ttftitles is working ok. put

    the_ttftext( “test text”, true )

    somewhere in your theme’s php, or in a php widget perhaps. that will output a gif of ‘test text’ in the default style.

    if that’s OK, then change the widget content filter to something more basic like:

    function ttftext_widget_title($content=”)
    { return “WIDGET CONTENT FILTER IS WORKING”.$content;
    }

    to add that text before every widget. Also just to check you are using actual widgets – not the theme’s default sidebar appearances – the widget_content filter only works on the widgets you configure in admin ‘appearance > widgets’

    if none of that helps, i don’t know what else I could offer other than to get stuck in to your server myself.

  24. hstilo on 19 February 2011 #

    Hello Again,
    In the end it was so simple I could kick myself. Basically, it was the code that you suggest all along. BUT I had to replace wherever it read h2 to read h3.
    Thanks again for all the help and the great plugin!

  25. Alan on 19 February 2011 #

    ha ha! yes that would do it! i should add a note to the effect that you need to adapt that code to the specifics of your theme. cheers, and i’m glad it worked out for you.

    A

Back up to post. More comments: All, 1–25, 26–50, 51–75, 76–100, 101–125, 126–150, 151–175, 176–200, 201–225, 226–250, 251–275, 276–300, 301–325, 326–350, 351–375, 376–400, 401–425, 426–469.

Add your comment

(Register first to guarantee your comments don't get marked as spam)