Title: I don&#8217;t understand compare=between function
Last modified: March 1, 2020

---

# I don’t understand compare=between function

 *  [pchlorenzo](https://wordpress.org/support/users/pchlorenzo/)
 * (@pchlorenzo)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/i-dont-understand-comparebetween-function/)
 * 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 6 years, 2 months ago by [pchlorenzo](https://wordpress.org/support/users/pchlorenzo/).

Viewing 1 replies (of 1 total)

 *  [codemonkeynorth](https://wordpress.org/support/users/codemonkeynorth/)
 * (@codemonkeynorth)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/i-dont-understand-comparebetween-function/#post-12941796)
 * [@pchlorenzo](https://wordpress.org/support/users/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.wordpress.org/Class_Reference/WP_Meta_Query](https://codex.wordpress.org/Class_Reference/WP_Meta_Query)
 * P.s. don’t prefix ACF fields with `acf` in the shortcode , just use `[field rsi...`
    -  This reply was modified 5 years, 11 months ago by [codemonkeynorth](https://wordpress.org/support/users/codemonkeynorth/).
    -  This reply was modified 5 years, 11 months ago by [codemonkeynorth](https://wordpress.org/support/users/codemonkeynorth/).

Viewing 1 replies (of 1 total)

The topic ‘I don’t understand compare=between function’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [codemonkeynorth](https://wordpress.org/support/users/codemonkeynorth/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/i-dont-understand-comparebetween-function/#post-12941796)
 * Status: not resolved