Display posts if meta_value included in ACF multi-select
-
Great plugin, a total saviour!
Right now I am trying to display posts that contain a meta_value added by an ACF (Advanced Custom Fields) field. All works correctly (the correct posts are shown) if the ACF field is a single-select field type, however if the ACF field is a multi-select field type no posts are shown.
Here is my current shortcode:
[display-posts meta_key=”brand_focus” meta_value=”123″ image_size=”full” wrapper=”div” include_excerpt=”false” excerpt_length=”20″ excerpt_more=”…” posts_per_page=”9″ columns=”3″]
From what I can tell, when the ACF field is mutli-select, the meta_value outputs become serialized arrays looking something like… a:2:{i:0;s:1:”123″;i:1;s:2:”346″}
Is there a way to make the shortcode meta_value search these serialized arrays for the value needed, in this case 123?
This article seems to be answering that it is possible (https://barn2.co.uk/querying-posts-by-custom-field-acf/), but I’m not sure how to implement this into your plugin?
Thanks in advance for any hints, tips and help!
- The topic ‘Display posts if meta_value included in ACF multi-select’ is closed to new replies.