• Resolved iantresman

    (@iantresman)


    I’m trying to display a post of a specific type that also has am ACF field set to a certain value, but without success. I’ve tried the following:

    [loop type=art field=feature value=1 compare=and count=1]
      [field title]
      [field image=image]
    [/loop]
    [loop type=art count=1]
       [-loop field=feature value=1]
         [field title]
         [field image=image]
       [/-loop]
    [/loop]

    Anything else I can try? I know that the ACF field feature does get set to 1, because I can display it.

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

    [loop type=art field=feature value='1' count=1]

    Thread Starter iantresman

    (@iantresman)

    I couldn’t get any of the following to work:

    [loop type=art field=feature value='1' count=1]
    [loop type=art field=feature value=1 count=1]

    The following selected all posts of type art, and allowed me to display the value of the field “feature”:

    [loop type=art field=feature]
    [loop type=art not field=feature]

    My ACF field “feature” is a checkbox, and the key is 1.

    Try:

    [loop type=art checkbox=feature value='1' count=1]

    See section LOOP part CHECKBOX in documentation.

    • This reply was modified 5 years, 7 months ago by polarracing.
    • This reply was modified 5 years, 7 months ago by polarracing.
    Thread Starter iantresman

    (@iantresman)

    That was it, I hadn’t clocked its significance before.

    Many thanks!

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

The topic ‘Select from post type and field value?’ is closed to new replies.