Hello,
Currently, I'm trying to set up a widget that displays itself on certain pages. To do this, I found the Widget Logic plugin. It takes any PHP argument, and if that argument returns as true, the widget will display.
I would like to create an argument that does the following:
- Allow me to pass a desired category slug
- Check the slug of the current category (or it's parent, if it is a subcategory)
- If the slug I passed matches the slug of the category, return true
I can't seem to get anything to successfully do this, though. The closest I have come is like this:
- Allow me to pass a desired category id (so, 12 instead of news)
- Check the slug of the current category (or its parent)
- So, the function does not return true because it expects a slug to match a number.
Any ideas on how I might be able to reconcile this? Thanks.
Jonathan