• Resolved islp

    (@islp)


    Hi, is there any way to build a sidebar widget that displays only in some cases? I don’t want to use something like Widget Logic: I want code, if possible, a widget that has this feature built-in. Can you help me?

Viewing 4 replies - 1 through 4 (of 4 total)
  • First write the code for the widget, then put if statements around the output.
    But if you want it for any widget and not just one that you write, you need a plugin.

    Thread Starter islp

    (@islp)

    @joyously Thanks, I thought a widget without echo would have thrown some error ??

    No, it would not be an error. But widgets are a little odd, because the widget area is (usually) defined by the theme, and it has the parameters for before and after markup. And that is called before the widget is. The widget itself has control of its own, but an empty widget can still have a container output.

    Thread Starter islp

    (@islp)

    @joyously thanks, it worked perfecly ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Build widget that displays under certain circumstances’ is closed to new replies.