Skip Navigation

[Resolved] Custom View with section

This support ticket is created 7 years, 12 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 8 replies, has 2 voices.

Last updated by Luo Yang 7 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#394503
Screen Shot 2016-05-03 at 4.11.58 PM.png

Dear Sir/Madam,

I want to create a page using Views to display the events by decreasing date order but in separated section by month. (see screenshot)

May I know how I can achieve it?

Best regards,

Kelvin

#394899

Dear Kelvin,

Here is a document about "How to group Views results by year and month":
https://toolset.com/2013/10/how-to-group-views-results-by-year-and-month/

Hope it help

#397510
Screen Shot 2016-05-12 at 6.05.26 PM.png
Screen Shot 2016-05-12 at 6.02.41 PM.png

Dear Luo Yang,

How can I use the View Query Filter to filter the custom post with a custom date field "press_date". I want to list out all the post which date if after this month. I try to set the filter press_date is a DATE greater than THIS_MONTH() but no result. I ensure there is a post with press_data in Jun (see screenshot).

Bet regards,

Kelvin.

#397831

Dear Kelvin,

The custom date field created with Types, which stores value as time-stamp (numeric) value, so you will need to change the option "DATE" to number, see our document:
https://toolset.com/documentation/user-guides/date-filters/

screenshot:
hidden link

#398274
Screen Shot 2016-05-14 at 11.50.58 PM.png

Dear Luo Yang,

Thanks for your reply. I finally can filter the post with custom field date after this month (see screenshot).

How can I pass a variable to the field after FUTURE_MONTH instead of giving a fixed number? I want to reapply this Views on different condition.

Best regards,

Kelvin.

#398278
Screen Shot 2016-05-15 at 12.16.16 AM.png
Screen Shot 2016-05-15 at 12.18.03 AM.png

Dear Luo Yang,

Before having the parameter passing solution, I temporary create 3 Views to filter the future, this month and past post. Refer to the screenshot I attached, there is a post which press_date is May 16, 2016 (this month), at what reason why the View cannot filter this post but only can filter the future and pass post? I did set the press_date is number and equal to THIS_MONTH.

Please advise.

Best regards,

Kelvin.

#398552

Q1) How can I pass a variable to the field after FUTURE_MONTH instead of giving a fixed number?
You can try add your custom " different condition" with Views filter hook wpv_filter_query, here is the document:
https://toolset.com/documentation/user-guides/views-filters/wpv_filter_query/

Q2) at what reason why the View cannot filter this post but only can filter the future and pass post?
As I mentioned above, the types custom date field stores time-stamp value, which include year + month + day + hour + minute + second
When you setup the filter as equal to this month, it means the date field equal to 2015-05-01 00:00:00
But the problem post field is setup 2015-05-16 00:00:00
So it isn't equal to, you will need setup the filter as between this month and next month

#398564
Screen Shot 2016-05-16 at 12.45.32 PM.png

Dear Luo Yang,

Thanks for your reply. the THIS MONTH issue fixed.

For the custom " different condition" with Views, I have no idea how it works. Is it possible to take my case as sample what I should do from the Views?

#398918

According to our new Customer Support Policy, we do not provide custom codes support, and here is a similar thread for how to use filter wpv_filter_query to add filter by custom date field:
https://toolset.com/forums/topic/make-date-between-inclusive/

For your reference.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.