Forums Forums Search & Filter Pro Post Archives Ability?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #202132

    Hi,

    In the Search Form UI builder, is it possible to add or use Post Archives as a field to filter by?
    Currently we are finding that we have to create a separate, custom Post Taxonomy called Archives and then create dates such as “December 2018” or “January 2019” to be categorised and then filtered by which is very long winded and almost unnecessary if the Post Archives already exist?

    Hope this makes sense!

    Thanks.

    Trevor
    #202139

    Are you trying to filter by date (month and year)?

    Anonymous
    #202141

    Hi,

    Just by month would be great.

    Thanks

    Trevor
    #202147

    Then, sadly you need to make a custom field to do that (or a taxonomy, but a custom field might be a better option) and base the Form UI field on that. You can automate the completion of that field by using the WordPress save_post() function in your child theme functions.php file.

    Anonymous
    #202202

    Hi,

    So saving the post would auto fill the custom field with the date published?
    Then I guess we’d have to set up the Form UI field based on dates between the first and last of each month using the custom field? (Am I along the right lines or talking nonsense?)

    Thanks.

    Trevor
    #202232

    Not that no. You would need some logic in the function you make that runs on save_post() being run by WordPress. It would fetch the post date and then work out which month it is, and then save the month name in to the Custom field.

    Anonymous
    #202236

    Thanks Trevor, will give it a go!

Viewing 7 posts - 1 through 7 (of 7 total)