Title: [Plugin: Widget Logic] Help needed with conditional statement
Last modified: August 20, 2016

---

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

 *  Resolved [caldoverde](https://wordpress.org/support/users/caldoverde/)
 * (@caldoverde)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/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/](http://wordpress.org/extend/plugins/widget-logic/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [caldoverde](https://wordpress.org/support/users/caldoverde/)
 * (@caldoverde)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-widget-logic-help-needed-with-conditional-statement/#post-2682276)
 * Solved this myself …
 * I found this plugin – [Category Template Hierarchy](http://wordpress.org/extend/plugins/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 ‘[Plugin: Widget Logic] Help needed with conditional statement’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/widget-logic_c8dde5.svg)
 * [Widget Logic](https://wordpress.org/plugins/widget-logic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-logic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-logic/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-logic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-logic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-logic/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [caldoverde](https://wordpress.org/support/users/caldoverde/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-widget-logic-help-needed-with-conditional-statement/#post-2682276)
 * Status: resolved