Slider set as query loop fetching my cpt “pop-event” .
I need to query the loop and display only post with acf field “lane_popup__options” value is Yes only.
Im confuse how to move from here , cause after slider there is no more elements to filter anymore. !
since its slider, the selection and filter , when does this happen ?
, i m guessing i should filter the post under META QUERY ? is this META QUERY for metabox plugin base field alone ? or can use for ACF Pro as well. ?
If it’s a Yes for ACF . How do i query it ?
Relationship : AND
Meta Key : Yes ?
Meta value : {acf_lane_popup__options}
Compare : Equal
Type : CHAR
my acf field is : lane_popup__options its a SELECT field with the options Yes, No
meta is wordpress - it stores all kinds of data as meta. ACF stores all its data as meta.m For a better understanding you can read:
and
Relationship : AND // yes - you want post AND it matches this criteria
Meta Key : {acf_lane_popup__options} // see below
Meta value : Yes // probably
Compare : Equal
Type : CHAR
It depends how you set ACF to return it’s data, but if ‘Yes’ works in a conditional, it should work in a meta query.
ACF actually stores its data as meta, so you can often just fetch it as meta, in which case just
Meta Key: ‘lane_popup_options’.
If one doesn’t work, try the other. In any case this is exactly what the meta search is for so should work.
i also wonder why Meta Key as no dynamic field fetch options ? need to manually key in once get it from the Meta Value ? sound like an enhancement needed ?
Both sliders support it. You just need to treat META as META in queries (so not acf_my_field // just my_field)
Plus, meta prefers LIKE to = when it’s a string and not boolean.