Viewing 5 replies - 1 through 5 (of 5 total)
  • You could add a text widget, put your text in widget content and use is_single( 'dialyse-mayotte' ) as logic.

    Thread Starter ludo2604

    (@ludo2604)

    the problem is I need to put different text for different page.

    if page 1 > echo text 1
    if page 2 > echo text 2

    You could add two text widgets, put your text 1 in widget 1, text 2 in widget 2 and use is_single( 'page-1' ) for widget 1 and is_single( 'page-2' ) for widget 2 as logic.

    Thread Starter ludo2604

    (@ludo2604)

    I can define only one Widget for those pages, that’s why i need IF conditions ??

    In this case would try a solution via a custom shortcode which outputs text based on pages and add this shortcode to your widget and not using Widget Logic.

    You might have to add add_filter( 'widget_text', 'do_shortcode' ); in functions.php of your theme.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘If Condition not working ?’ is closed to new replies.