Skip Navigation

[Resolved] Filter post/page date publish

This support ticket is created 4 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 11 replies, has 2 voices.

Last updated by Shane 4 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1676259

Hi,
it is possible create date pubblish filter into view?
Regards

#1677001

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

Thank you for getting in touch. Unfortunately no its not possible to do this. You can only create a frontend filter for custom fields.

Is this a static filter or a frontend filter?

Thanks,
Shane

#1677557

Hi Shane,
I would like to create a filter as date from and to for filter my content.
It is not possible?
Regards

#1678069

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

It is not possible to do with the Post Publish Date , however if you create a custom date field where the user enters a date then you can create a frontend filter based on that field.

Thanks,
Shane

#1684817

Perfect. How should I proceed?
Regards

#1685353

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

Go to Toolset -> Custom Fields and create a new custom field group and add a date field to that custom field group.

Secondly when the user creates the Post they can populate this date field with the value they want.

Finally when you are creating your View Block you can select this date field as a frontend filter.

Please let me know if these steps were clear enough or if further clarification is needed. You can also let me where you are stuck.

Thanks,
Shane

#1685359

It is not possible to create a post_type_filter_func on the wordpress data field?

#1685367

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

Do you want to filter by a post type ? can you provide a little more information?

If so then this is not natively possible with our plugin to filter by the post type, however you can use some custom coding to add a custom post type filter.

https://toolset.com/forums/topic/creating-a-view-that-filters-by-post-type/

Take a look at the thread above.

Please let me know if this helps. Also I recommend you use our Views plugin if you are going to employ the use of custom coding.

Thanks,
Shane

#1685375

Hi Shane,
I would like to filter by post / page date as a method from and to.

#1685411

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

If you want to filter by the Post Date you will need employ the method highlighted here
https://toolset.com/forums/topic/filter-post-page-date-publish/#post-1685353

With the custom field you are able to do a comparison between 2 date fields and filter for posts that are between those two dates. However as mentioned you're not able to do this with the default date field that comes with wordpress. You will need to create a custom field for that date that you want to filter by.

I hope I was able to explain this a little clearer for you.

Thanks,
Shane

#1685423
Cattura.PNG

Ok, why do I have this value from the view filters? Can't I use it from here?

#1685601

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

What you have there is a backend filter. If you want to create a static filter on the backend then you can. This will result in the view always being filtered by this value.

However if you want your users to dynamically filter the view on the frontend then you will need to use a custom field. If you don't want your users to filter from the frontend but have the view filtered by a constant value then you can filter by the Post Date.

Hopefully this clears the difference up a bit more for you.

Thanks,
Shane