Title: Dynamic Logic Queries
Last modified: August 21, 2016

---

# Dynamic Logic Queries

 *  [trevolutionary](https://wordpress.org/support/users/jkdsouljah/)
 * (@jkdsouljah)
 * [13 years ago](https://wordpress.org/support/topic/dynamic-logic-queries/)
 * I don’t know if I’m barking up the right tree here, but… I’ve set up a bunch 
   of simple text widgets which provide links for people to subscribe to RSS feeds
   of specific categories I’ve set up in WordPress. Then I’ve isolated each widget
   to display only on the relevant category page with Widget Logic, e.g.
 * > `Widget Content: <a href="Feed URL">image</a> Get [Category 1] updates delivered
   > to your device. Subscribe to the RSS feed in your favourite RSS reader.`
 * > `Widget Logic: is_category ( 1 ) || in_category ( 1 )`
 * And it works fine.
 * However, I’d rather not have to do this for every single category that I have
   set up. Therefore I was wondering whether there is a way to dynamically generate
   the parameters in the logic statement through PHP. Such that I’m not specifying
   a category as such, but rather a call to retrieve the category that the viewer
   is looking at. It doesn’t have to be in a widget – I’m happy and comfortable 
   to edit template files.
 * Hope that makes sense. Thanks in advance.
 * [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 ago](https://wordpress.org/support/topic/dynamic-logic-queries/#post-3724205)
 * How are you going to generate the content which presumably will vary per category
   too?

Viewing 1 replies (of 1 total)

The topic ‘Dynamic Logic Queries’ 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/)

## Tags

 * [logic](https://wordpress.org/support/topic-tag/logic/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 1 reply
 * 2 participants
 * Last reply from: [alanft](https://wordpress.org/support/users/alanft/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/dynamic-logic-queries/#post-3724205)
 * Status: not resolved