• pchlorenzo

    (@pchlorenzo)


    What’s the correct way to compare this field value between 10 and 110?

    [if field=rsi_derechos_humanos compare=between value=10,110]
    [acf field=”rsi_derechos_humanos”]
    [else]algo va mal
    [/if]

    It doesn’t work. What I am doing wrong?

    Thank you in advance..

    Please help.

    Pablo

    • This topic was modified 5 years ago by pchlorenzo.
Viewing 1 replies (of 1 total)
  • @pchlorenzo I think you can do it like this

    [if exists]
    [loop field=rsi_derechos_humanos compare=between value=10,110
    include=this]
    [field rsi_derechos_humanos]
    [/loop]
    [else]
    algo va mal
    [/if]

    It’s still doing a loop so it’ll check all pages if you leave out include=this

    I don’t think compare works with just [if field...]. Presumably it’s doing a meta_query whereas [if field... isn’t
    https://codex.www.ads-software.com/Class_Reference/WP_Meta_Query

    P.s. don’t prefix ACF fields with acf in the shortcode , just use [field rsi...

Viewing 1 replies (of 1 total)
  • The topic ‘I don’t understand compare=between function’ is closed to new replies.