Title: Using PHP in Widget Logic
Last modified: August 20, 2016

---

# Using PHP in Widget Logic

 *  [DougEvans](https://wordpress.org/support/users/dougevans/)
 * (@dougevans)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/using-php-in-widget-logic/)
 * Hi,
 * First, this is a great plugin, the possibilities are endless, thanks!! I am fairly
   new to PHP and a little confused with all of the extras that you have put into
   this plugin to cut down on the coding. I am hoping you can help me to use a variable
   that has already been set within my website. Right now I am trying this code 
   but its not working and am hoping that it’s just a minor tweak:
 * global $post; return (!is_page(array(‘lunch-menu’,’dinner-menu’)) && ($post->
   responsiveDesign.isDesktop==true));
 * I found this variable using Firebug, in the DOM area.
 * If anyone could give some guidance I would really appreciate it!
 * Thanks in advance,
    Doug
 * [http://wordpress.org/extend/plugins/widget-logic/](http://wordpress.org/extend/plugins/widget-logic/)

Viewing 1 replies (of 1 total)

 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/using-php-in-widget-logic/#post-3204558)
 * I think if you found that variable in the DOM then that’s not (directly) accessible
   to PHP – it’s more likely a CSS class. I expect you have a plugin that outputs
   the class setting, so perhaps you can get to that more directly from whatever
   that plugin does?

Viewing 1 replies (of 1 total)

The topic ‘Using PHP in Widget Logic’ 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
 * 2 participants
 * Last reply from: [alanft](https://wordpress.org/support/users/alanft/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/using-php-in-widget-logic/#post-3204558)
 * Status: not resolved