• Resolved Klaas Koopman

    (@inspired-media)


    Dear Support,

    Currently I’m working with a CPT that has ACF fields and I want to loop a CPT based on a term that’s inside of one of those ACF fields. But the cpt results have a different name, for example:

    Computer
    Computor
    A Computer

    How do I get the results based on the value, but instead of exact (=) it’s like? So if I use (value=comput) it shows all three of the above?

Viewing 12 replies - 1 through 12 (of 12 total)
  • use contains=

    Thread Starter Klaas Koopman

    (@inspired-media)

    Thank you for your reply. THat actually breaks the page (can’t even open it in my wp-admin)?

    A sorry, contain works only in if clauses, in a loops you could use start=

    Thread Starter Klaas Koopman

    (@inspired-media)

    Okay now I have 2 questions:
    1. How do I edit the page, since I can’t open it the page anymore?
    2. Start is only for when it’s at the start right? But as you can see in the list, 1 doesn’t start with ‘comp’ but with ‘A ‘:
    Computer
    Computor
    A Computer
    So will this still work?

    1. Disable this Plugin, open the page, edit and save – reactivate the plugin again.

    2. Nope. Then you have to work around with an if clause and use contains.

    Thread Starter Klaas Koopman

    (@inspired-media)

    Thank you for 1. Done that.

    2. Could you give me an example I can work with? Currently I have:
    [loop type=study field=study_name contains=’architecture’]

    And I need:
    – architecture
    – architect
    – the architecture

    [loop type=study]
    [if  field=study_name contains=’architect’]
    DO WHAT YOU LIKE
    [/if]
    [/loop]
    • This reply was modified 5 years, 3 months ago by polarracing.
    Thread Starter Klaas Koopman

    (@inspired-media)

    I tried that, but it’s showing all the posts of the type=study now?

    If I try that with some of my content it works great.

    [loop type=circuit]
    [if field=title contains='burg']
    [field title]
    [/if]
    [/loop]

    Gives me the only correct post named “*burg*” i.e. Hamburg. Also it would give me hamburger

    • This reply was modified 5 years, 3 months ago by polarracing.
    • This reply was modified 5 years, 3 months ago by polarracing.
    Thread Starter Klaas Koopman

    (@inspired-media)

    Ah I see what the problem was, I’ve got multiple [if]’s in my file to only display certain code if a certain acf field is filled. So I guess you can’t have an [if] within another [if]?

    If so, how to only display certain code, if a certain field is filled?

    Or can we have an if within an if?

    There is a documentation telling you all of that.

    Yes, its possible to use multiple nested [if]. Use [-if] for nested.

    Thread Starter Klaas Koopman

    (@inspired-media)

    Thank you, that fixed it! Great support!

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

The topic ‘Value ‘like’ instead of exact?’ is closed to new replies.