WordPress.org

Support

Support » Plugins and Hacks » Widget Logic » [Resolved] [Plugin: Widget Logic] Help needed with conditional statement

[Resolved] [Plugin: Widget Logic] Help needed with conditional statement

  • I’ve installed this plugin and it looks like it ought to do exactly what I want it to – which is to display text widgets containing menus in different languages according to post language categories – but I’m struggling to get the correct php syntax. I’ve been through all the examples in the plugin documentation, but I’m not getting it right – it’s either not displaying the widget or it’s giving me a parse error.

    What I want to say in php is …

    is a category which is a subcategory of the category [language] OR is a single page AND in a category which is a subcategory of the category [language]

    Can any passing php wizard help me out with this please?

    http://wordpress.org/extend/plugins/widget-logic/

Viewing 1 replies (of 1 total)
  • Solved this myself …

    I found this plugin – Category Template Hierarchy – which adds the conditional tag is_child_of_category();

    Since there’s no in_child_of_category();, I categorised all the single posts with their respective language rather than relying on the category hierarchy, giving the complete statement …

    is_child_of_category(‘language’) || (is_single() && in_category(‘language’))

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Widget Logic] Help needed with conditional statement’ is closed to new replies.
Skip to toolbar