• dewisarifahambami

    (@dewisarifahambami)


    Hello . i want have shortcodes like this
    [if field=geodir_post_category contains=1779]
    <div class=”wpapps-popup-green”>[perks_popup_preview] </div>
    [elseif field=geodir_post_category contains=1803]
    <div class=”wpapps-popup-green”>[perks_popup_preview] </div>
    [else]
    <div class=”wpapps-popup-purple”>[perks_popup_preview] </div>
    [/if]

    . But its not working , can you just tell me where the error is? or is there another way?
    I’ve try like this too , but still not working
    [if field=geodir_post_category contains=1779,1803 compare=or]
    <div class=”wpapps-popup-green”>[perks_popup_preview] </div>
    [else]
    <div class=”wpapps-popup-purple”>[perks_popup_preview] </div>
    [/if]

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • polarracing

    (@polarracing)

    Try:

    [if field=geodir_post_category contains='1779']
    ...
    [else]
      [-if field=geodir_post_category contains='1803']
        ...
      [/-if]
    [/if]

    or:

    [if field=geodir_post_category value='1779,1803' compare=or]
    ...
    [else]
        ...
    [/if]
    Thread Starter dewisarifahambami

    (@dewisarifahambami)

    Hello,

    Its working. Thank you!

    polarracing

    (@polarracing)

    Then please close this case

    CCS switch also works elegantly in this case: ??

    [switch field=my_test_text]
        [when contains='1779']Value 1779[/when]
        [when contains='1803']Value 1803[/when]
        [when default]Default[/when]
    [/switch]
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘If and else if’ is closed to new replies.