• Resolved siamak2016

    (@siamak2016)


    Hi
    I created some Metabox with WCK Custom Fields Creator (some field as cupname, year, numberofteam,…) for each tournament, but i can’t find how filter tournement by, for exemple year>1938

    [for type=tournements]
    Recent [each plural lower=true]
    [loop field=year value>1938]
    [field title-link]
    [/loop]
    [/for]

    This code list all my tournements
    my metabox name is Tournement structures but i don’t see how and where to use it

    thanks a lot
    siamak

    https://wordpress.org/plugins/custom-content-shortcode/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    WCK fields are stored differently than “normal” custom fields, because they’re inside a metabox (which is an array field). For this reason, they can’t be queried by field value when using the [loop] shortcode. However, I think you can work around it by using [if].

    [for type=tournements]
    Recent [each plural lower=true]
    [loop]
    [if metabox=tournement field=year value=1938 compare=more]
    [field title-link]
    [/if]
    [/loop]
    [/for]

    Please note the syntax for setting metabox and comparing field value.

    Since metabox names cannot contain a space, it’s probably not ‘Tournement structures’ but something like tournement-structures. By the way, the correct English spelling is “tournament” with an “a”. It’s a commonly misspelled word.

    Thread Starter siamak2016

    (@siamak2016)

    Great it’s work perfectly.
    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Metabox, row’ is closed to new replies.