Title: [Plugin: Widget Logic] Widget-Logic does not run conditional statements
Last modified: August 19, 2016

---

# [Plugin: Widget Logic] Widget-Logic does not run conditional statements

 *  [Dachande663](https://wordpress.org/support/users/dachande663/)
 * (@dachande663)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-widget-logic-does-not-run-conditional-statements/)
 * Widget-Logic does not seem to want to work on text widgets under WP 2.6. It stores
   the conditional statements but doesn’t seem to execute them as widgets are shown
   at all times. Anyone else had a similar problem or know of a fix?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [Dachande663](https://wordpress.org/support/users/dachande663/)
 * (@dachande663)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-widget-logic-does-not-run-conditional-statements/#post-837784)
 * Update; it seems using query_posts() on a page before displaying a widget resets
   the $post object and as such widget-logic doesn’t see the actual page it is on,
   but rather the results of the new query.
 * However, even using return false; will still allow the widget to be shown! It
   seems the eval() statement is not run for some reason.
 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-widget-logic-does-not-run-conditional-statements/#post-837822)
 * not seeing this on my local install
 * just tried now with a recent comments and 2 text widgets, with one text widget
   set to !is_home() and it does indeed only appear on non-home pages.
 * :-/
 * i’m not exactly on the ‘stable release’ of the plugin right now – but it’s not
   all that different. also only on 2.6, not 2.6.1. what version of WP and widget
   logic are you using?
 * scratching my head now, but just as a random trial… what happens when you use
   just `false` instead of `return false;` ?
 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-widget-logic-does-not-run-conditional-statements/#post-837827)
 * i just tried on 2.6 and the ‘stable’ 0.43 version of WL plugin and it was ok 
   too. are you on 2.6.1? i will have a go at updating my local install if so to
   track this down.
 *  Thread Starter [Dachande663](https://wordpress.org/support/users/dachande663/)
 * (@dachande663)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/plugin-widget-logic-widget-logic-does-not-run-conditional-statements/#post-837878)
 * Hey alanft, thanks for getting back to me. It turns out it was the stupidest 
   of mistakes. A fellow developer on the project had disabled wp_head() from running,
   hence the lack of anything working. Brilliant plugin, sorry to take up your time.
 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/plugin-widget-logic-widget-logic-does-not-run-conditional-statements/#post-837880)
 * phew 😀

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: Widget Logic] Widget-Logic does not run conditional statements’
is closed to new replies.

 * 5 replies
 * 2 participants
 * Last reply from: [alanft](https://wordpress.org/support/users/alanft/)
 * Last activity: [17 years, 8 months ago](https://wordpress.org/support/topic/plugin-widget-logic-widget-logic-does-not-run-conditional-statements/#post-837880)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
