Control Your Widgets with Code with Widget Logic
Widgets have been a core feature of WordPress. Controlling them, however, is something that a patchwork of solutions are devised for and done with. The one we’re covering today is Widget Logic, a plugin. The plugin is great if you’re writing PHP code for WordPress already, as it’s remarkably similar to doing that. But it’s much more convenient.
If you’ve never really programmed before though, I would recommend something that’s more interface-driven. Widget Logic is merely a big text box, which if you’re not a programmer is likely to be inscrutible and confusing. Perhaps try the Jetpack feature Widget Visibility, which we’ve covered in a Quick Guide.
Here’s the video:
And for the text-lovers out there…
Using Conditional Tags with Widget Logic
- Install and activate the Widget Logic plugin.
- Go to your widgets, probably in the Customizer.
- Select the widget you’d like to control, expand it. You’ll notice a new “Widget logic:” section at the bottom. That box is where you write your code. It’s basically a place for you to make use of WordPress’s Conditional Tags.