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,725 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. admin on 21 March 2009 #

    sorry Trina – if the corrected head.php doesn’t fix it, and it is the theme to blame (did you say the problem goes away in the default theme?) then i really don’t know where to go next. i might try a test install of that theme and try it myself. not today though.

    marilu – http://codex.wordpress.org/Conditional_Tags is an essential guide to the syntax of most logic you need. and you will find what you want under the bit on PAGEs.

  2. Trina on 22 March 2009 #

    I’ll try and look up more information but where in the process does it look to see if there is a variable set in widget_logic? Is it in sidebar.php? Or a file before that? That way I can see if the function is ever called.

  3. Dainis on 24 March 2009 #

    I tried to use is_user_logged_in(‘false’) to show a newsletter subscription widget only if users are not logged in. That means “show this widget if user is a guest (not logged in).

    both
    is_user_logged_in(‘false’)
    is_user_logged_in(‘true’)

    display the widget only if the user is logged in, and I want it to be if the user is not logged in.

    I was thinking about validate_username(‘false’) …

    Since this is one of my few attempts to use any kind of functions, I could likely be doing something boneheaded!

    PS: Definitely a cool and useful plugin!

  4. admin on 24 March 2009 #

    it’s just is_user_logged_in() and doesn’t take any values

    as usual in PHP to get the reverse you put ! at the beginning to add a logical NOT to the code:

    !is_user_logged_in()

  5. Dainis on 1 April 2009 #

    Awesome admin! How cool! Sending you a big smile from Vienna. Now I’m off to figure out how I can add a “widget” to the top part of my home page, in the “content” area and not the side bar.

    Can I send you a buck or two via PayPal?

    Best,
    Dainis

  6. unibet on 1 April 2009 #

    I confirmed !is_user_logged_in()

    Thank you for this topic

  7. Thomas Clausen on 9 April 2009 #

    Love the plugin, but it seems it has a little bug, see more here: http://themehybrid.com/support/topic/hybrid-051-bug-report#post-19441

  8. Alan on 9 April 2009 #

    well i can’t view all that post as i’m not signed up for that site. if someone posts a description of the issue on the wordpress widget-logic tag forum i’ll see what i can do.

  9. Thomas Clausen on 9 April 2009 #

    Now I’ve done that.

    Sorry I forgot that you have to be logged in to see what Justin writes.

    Basically it’s just when I use widget logic to display a widget on only 1 category page, then the rest of the pages shouldn’t display anything (and they don’t), but the page should also be in full width, and this isn’t the case.

    According to Justin: “It’s because the plugin doesn’t “deactivate” the widgets while on that page. They’re still being read as active by WordPress.”

  10. Shawn Ryder on 17 May 2009 #

    I have wanted to set up some Podcasts – so great information, thank you.

  11. BdF on 17 May 2009 #

    Works fine on my site with WP 2.71 French version. I use it to have the Video-Widget sidebar widget display a random video in the sidebar only when on the front of the site, using the conditional tag is_front_page().

    Merci beaucoup!

  12. Luc on 25 May 2009 #

    Seems to work OK with 2.7.1, but gives an error when activating, and when saving the logic for a widget. It does install, and does save the logic though, so if you only intend to use it once when setting up your widgets, it does the job nicely.

  13. admin on 25 May 2009 #

    any more info on those errors, i’ll investigate – tho it would be great if you could see if it was theme specific or if it’s still there when all your other plugins are off

  14. Mike on 27 May 2009 #

    Vielen Dank für diese guten Informationen,
    mein Englicsch ist zwar nicht so gut, aber es hat gelangt

    Mike

  15. stuart on 28 May 2009 #

    Hi,

    I have added this widget to my site, (great widget) However I require my visitors to log into the website via google friend connect. The widget then seems to not realise that they are logged in even though wordpress does. I have tried it with just the single page function and it works great so I knwo the plugin works , plus when I log in as administrator it works fine but when I test it as a google friend it still appears using !is_user_logged_in()

    be great if someone could shed some light :)

  16. admin on 28 May 2009 #

    i don’t know a great deal about google friend connect, but a quick look around the net makes me think that if you have logged into it, that this is entirely separate to the wordpress login mechanism. so is_user_logged_in() isn’t going to be at all relevant to being logged in via GFC.

    but sadly, i don’t know what mechanism you COULD use to identify people logged in via GFC. it looks entirely javascript driven and ‘client side’ – so the server won’t be able to tell.

    sorry – if anyone can shed light on this, i’d be grateful.

  17. Itzsnider on 12 June 2009 #

    Widget Logic is broken – or at least a ton of us are having issues with it. With 2.7.1 2.7 and on 2.8. Please help us out here. They keep dissapearing after adding the widget logic.

    http://wordpress.org/support/topic/278187?replies=3#post-1098929

  18. Alan on 12 June 2009 #

    there is a problem with WL and 2.8, which I think i’ve already solved. will be updating the WP repository soon.

    UPDATE: the Development version here will shortly be my first attempt at a 2.8 version (with some extra fixes thrown in).

    I don’t think there are any general problems with WL and WP2.7 – though there are theme-code-related issues and one specific GUI issue. hoping to address some of these in the 2.8 version coming soon…

  19. Kendra on 13 June 2009 #

    I have been trying to use Widget Logic to use the TTF Titles plug in for my Widget titles. The function code for the ttftitles returns tons of errors. The most common one is an “unexpected $end error” I don’t know if I am not doing it right or what. I copied and pasted this code:

    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;
    }

    I am no PHP expert so is there any way you can give details on what to do with it and what changes to what and what closes it, etc? Thank you!

  20. admin on 13 June 2009 #

    as you’ve taken this to the wordpress forums, i’ve answered there too.

  21. Kendra on 13 June 2009 #

    Awesome, thank you so much. :)

  22. Dainis on 18 June 2009 #

    Hiya, what a wonderful tool this is! Thanks a bunch. Now I’m trying to do the following:

    Don’t show if user is not logged in and don’t show if user is not logged in and at this particular page

    These are the pieces:

    !is_user_logged_in()

    !is_page(‘recently-acquired-tinnitus-survival-ecourse’)

    But I don’t know how to make the logic work:

    So !is_user_logged_in() OR
    !is_user_logged_in() && !is_page(‘recently-acquired-tinnitus-survival-ecourse’)

    But what kind of parens do I need?

    Best and thanks a ton! :-)

  23. Alan on 18 June 2009 #

    i updated the notes and faq on the WP site http://wordpress.org/extend/plugins/widget-logic/other_notes/ which might be of some help

    i’m a bit confused by the logic you want – it seems like the first case !is_user_logged_in() would be true before you get to OR with the second case which is ‘!is_user_logged_in() AND something’ ie a subset of the first case.

    perhaps you’ve got tripped up over too many “don’ts’ and “nots”. try restating what you want in terms of when you DO want the widget to appear.

  24. mllehman on 19 June 2009 #

    My widgets are also disappearing when I save, and I’m not quite sure what to do. I am using wordpress 2.7.1 and Widget Logic 0.46.

    What should I do to fix this problem?

    (I have also left a more detailed question in the forums here: http://wordpress.org/support/topic/278187/page/2?replies=44#post-1110113

    Thanks in advance for your help!

  25. admin on 19 June 2009 #

    replied on the wp forum

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)