Forums › Forums › Search & Filter Pro › Set Default Sort Order to a ACF Custom Field + Post Meta Tab CurrentDate
- This topic has 6 replies, 2 voices, and was last updated 6 years, 2 months ago by
Anonymous.
-
Anonymous(Private) February 17, 2019 at 12:54 am #202485
Hello.
I would like help with 2 items
1) Set Default Sort Order to a ACF Custom Field
2) Use Post Meta Tab to filter results based on current date(‘Ymd’)1) Set Default Sort Order to a ACF Custom Field
I have an “Events” custom post_type which I would like to set the Default order in Search Filter Pro to be an ACF Date Field.
How can I do this?
See screenshot for reference: http://www.kubikdesign.com.au/posts/search-filter-pro-support-acf-default-order-20190217.png2) Use Post Meta Tab to filter results based on current date(‘Ymd’)
Same “Events” custom post type, I would like to use the meta tab to filter out posts who’s ACF custom field “event_date” is “<” the current date.
I can see that this should be possible, but am struggling to implement.
Please see the video for full details.Video: http://www.kubikdesign.com.au/posts/search-filter-pro-support-meta-tab-20190217.mp4
Thank you.
=)Trevor(Private) February 17, 2019 at 7:08 pm #202495With regard to #2, we do not support <, >, <=, >= or != as operators. We support only =. This means #2 cannot be done.
To set a Custom Field as the sort order, select Post Meta (which is what a Custom Field is) and then select the Meta Key. Note that you need to select (when using ACF fields) the meta key that DOES NOT have a name preceded with an underscore. NOTE: Any post not having a value in this custom field will be excluded from the results.
Anonymous(Private) February 21, 2019 at 2:37 am #202818Hi Trevor.
I have had some success and new discoveries.
In regards to #2 I think I had selected the value with the underscore prepended.
So have that now working.In regards to #1 I didn’t know you could do that, so tried it but it didn’t order items as expected because the field ‘event_date’ is a date field, it doesn’t work/order as expected when I choose either Alphabetical or Numerical. Are you able to create another option ‘date’ for it to work as expected?
Watch the video for more detail: http://www.kubikdesign.com.au/posts/search-filter-20190221-01.mp4
Cheers.
=)Anonymous(Private) February 21, 2019 at 9:58 pm #202947Hi Trevor.
Thank you so much that did the trick.
It is refreshing to work with someone like you, so responsive to helping and a great plugin which is so flexible and can do what I need with no nonsense.
Thank you for great support and a great plugin.
=) -
AuthorPosts