WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Condtional tags in Widget (2 posts)

  1. viwiv
    Member
    Posted 5 years ago #

    Hello. I look for a way to use conditional tags in Widgets, without using "Widget Logic".

    So, in 'function form($instance)', I use a field '$conditional'. In Widget Panel, I use a value example like 'if (is_single())'.

    Before 'echo $before_widget', I write 'if ($conditional)': my script verifies the condition ('yes'/'no'), but does not apply it! The value of '$conditional' passes correctly, because I can display it in Widget to test.

    Any help would be greatly appreciate. Thank you.

    Vincent

  2. viwiv
    Member
    Posted 5 years ago #

    Hello,

    1. I am sorry for the spelling mistakes in the title of the question.

    2. I eventually found my personal, but functional solution, to implement the conditional tags in Widgets of my theme under construction. :)

    So my problem is solved.

    Thank you.

    V.

Topic Closed

This topic has been closed to new replies.

About this Topic