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,917 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–470.

  1. admin on 12 February 2009 #

    no worries, not your english i suspect. i just don’t know what an SSI declaration is, or what an SMF is either :-(

  2. lorenzo on 13 February 2009 #

    Oh, I see, well it’s with great pleasure that I’ll intoduce
    you to http://httpd.apache.org/docs/1.3/howto/ssi.html
    and http://www.simplemachines.org

    sharing knowledge, a lot less than what you already do :)

    Thanks

  3. Einar on 14 February 2009 #

    Nice idea but it’s kinda buggy.

    Like moving a widget higher up in the sidebar and suddenly it is no longer visible on the page.

  4. admin on 14 February 2009 #

    that’s not something i’ve ever noticed happening with widget logic. if you could describe the problem step-by-step i’ll check to see if it’s my plugin or WP code that’s at fault.

  5. admin on 14 February 2009 #

    back to lorenzo. Server Side Includes! i haven’t thought about those in a while!

    ok, so “would this ‘work’ to call inside my WP the SSI of my */forum?”

    no i don’t think there’s anything relevant to SSI usage in my plugin. However within WP as a whole as it’s PHP, there’s more than enough functionality there to pull in includes like the very basic SSI functionality of apache.

  6. Steven on 18 February 2009 #

    Hi,

    The Widget logic code !is_page(‘some-page’) works fine while the code is_home() does NOT do anything??

    I want to turn off a widget on only the Home page. I presume this is the way to do that..?!

    The Widget content filter is checked and I use WP 2.7.1.

  7. admin on 18 February 2009 #

    you don’t need the widget_content filter ticked – that doesn’t effect the widget logic fields or whether widgets appear on this or that page.

    have you read http://codex.wordpress.org/Conditional_Tags#The_Main_Page and particularly the difference between is_home() and is_front_page() ?

  8. Steven on 19 February 2009 #

    Un-ticking the widget_content filter makes all widget logic fields go away. So I leave it ticked.

    I did read this help file but it is written for technical people. I have a static page as the home page and I want to know what to use in the logic fields to set a sidebar widget only to display ont the static home page.

    I tried these:
    is_home(), is_front_page() and is_page(‘home’). None of them works..

    Thnx in advance :)

  9. admin on 19 February 2009 #

    “Un-ticking the widget_content filter makes all widget logic fields go away”

    OMG YOU ARE RIGHT. this appears to be a really long standing bug i reckon. However it is just when you change that option. if you reload the widget page, the fields re-appear intact. i will attend to this v soon. i can’t believe this has only just been brought to my attention now – i’ve only just done a little update :-(

    but thanks still!

    meanwhile your separate issue…
    try disabling any cache features you have. any difference?
    try switching to the WP default theme. any difference?

  10. Steven on 20 February 2009 #

    The default theme does seems to be ok with the widget logic code is_front_page() . How can I make it work for my site?

    I do not know much about the WP (and php coding). I have read something about the code wp_head() somewhere(?) but I do not know what to do with it exactly..?

    I am using this theme (http://neewee.com/wordpress/mumrik-wordpress-theme/) for my website.

    PS. Your server seems to be very slow (many 503 errors).

  11. Trina on 4 March 2009 #

    I am also using a different theme – Stars (http://www.premiumwp.com/the-stars-a-free-premium-wordpress-theme/) and am having widget logic errors.

    Warning: Illegal offset type in /home/katchoo/dev/wp-content/plugins/widget-logic/widget_logic.php on line 125

    Warning: Illegal offset type in /home/katchoo/dev/wp-content/plugins/widget-logic/widget_logic.php on line 128

    Warning: Illegal offset type in /home/katchoo/dev/wp-content/plugins/widget-logic/widget_logic.php on line 125

    Warning: Illegal offset type in /home/katchoo/dev/wp-content/plugins/widget-logic/widget_logic.php on line 128

    Here is my dev site:http://dev.gamingangels.com/

    I’ve tried searching the web and wordpress forum to see if anyone has the same problem, but no one has yet. I did start a forum on WordPress but I’d love to get your opinion on what I can do next.

    Thank you for your time!
    Trina

  12. Alan on 4 March 2009 #

    And we’re back. steven, trina, i’ll have a look at those themes. trina – i already noticed your post on WP forums and asked for a link to the theme you are using. which i see here. cheers. will let you both know what i find

  13. admin on 5 March 2009 #

    trina – i have answered more fully on the wp forum with suggested fixes (the problem is that wp_head() is called twice in the theme)

    steven – the sidebar.php code in your theme calls dynamic_sidebar (which is to say it outputs the widgets) after a special ‘query_posts’ command, which resets all the values of is_home etc based on that query.

    the code says that query runs only if you have a selected “mumrik_featured_category_id”. (it looks like you can unset it by choosing the top “Select Category for Featured Articles” item from a drop down somewhere)

    Someone has a similar issue before and they found that adding a `wp_reset_query();` fixed it. so have a go at putting that in before the sidebar is called on line 41.

  14. LJGreene on 7 March 2009 #

    Hi Alan

    Thanks for the plugin! I downloaded it so I could use it with TTFTitles, but i need a bit of help. This is likely a stupid question, but that should make it an easy answer!

    i’ve activated the plugin and added the filter and function codes to my function.php, but I’m uncertain about my next step. Is there something I need to put in the widget logic field to utilize TTFTitles for my widget titles? If so, can you tell me what the PHP code is?

    I don’t know if this makes a difference, but i’ve added a second style to TTF to use as font for my sidebar titles. So it won’t be the default font that i use with WL.

    Thank you!

  15. admin on 7 March 2009 #

    so go through this checklist:

    1 tick the ‘widget_content’ option on the widget admin page
    2 register a new function to go on that filter using add_filter(‘widget_content’, … etc
    3 supply the function for the filter (that uses the_ttftext function)

    that should do it. the suggested code on the WP plugin page to do widget titles uses the_ttftext( $heading, false ); which should render the text in the default style you have configured in TTFTitles setup.

  16. LJGreene on 8 March 2009 #

    Thanks Alan

    I’d already done steps 1-3 as suggested on the plugin page and the sidebar/widget titles weren’t impacted, so i thought there must be another step involved. Like putting something in the empty WL field.

  17. Rhys on 9 March 2009 #

    is there a way to use a statement similar to the one below, that looks at all ancestors, not just the immediate parent? i have a multiple level site structure.

    global $post; return ($post->post_parent==”31″);

    great plugin btw

  18. Alan on 9 March 2009 #

    according to http://wordpress.org/support/topic/227954 you might try

    global $post; return (in_array(31, get_post_ancestors($post)));

  19. Rhys on 9 March 2009 #

    Great, thanks Alan.

    I did have a good look around, but missed that thread.

    works perfectly…

  20. Julian on 19 March 2009 #

    Yay, now I can really use WordPress as a CMS, awesome, thanks heaps!

  21. admin on 19 March 2009 #

    Today the WP repository recorded the 10,000th download of Widget Logic.

    :-)

    Now, I’ve always been meaning to ask people – how could I make a simple interface instead of (as well as) the generic ‘write PHP code’ approach

  22. Trina on 20 March 2009 #

    I’m sorry but I’m still having problems with this module. While I don’t get the errors above anymore, the widget logic does not appear to be working.

    I have checked the ‘use widget-content filter’ and on the widgets in the side I tried any conditional statement like is_home() and the widgets still appear in all the sidebars.

    I guess it’s the Stars theme, but do you have any ideas of what I should look for?

  23. Alan on 20 March 2009 #

    looks like you saw comment 88, as you have responded on the WP forum?

    if you’ve done that fix and it’s still not right, try the other suggestion i made in the wp thread which is to edit the theme’s header.php

  24. Trina on 20 March 2009 #

    I am not getting those header errors anymore. It just seems the widget logic conditions that I pass are being completely ignored. Where would I find that in the code?

  25. marilu on 21 March 2009 #

    I’m trying to use widget logic with the flexi pages widget to have two different menus I can use on specific pages but I can’t figure out (have looked at your other answers and wp conditional tags info) how to combine a command like this example: is_page(‘home’;'about’; ‘biography’; ‘ect’) to make those pages show up for that menu.
    what is the correct syntax for listing multiple pages?
    Grateful for any help.

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–470.

Add your comment

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