Skip Navigation

[Resolved] Filter concerts based on current date.

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 3 voices.

Last updated by Minesh 1 year, 4 months ago.

Assisted by: Minesh.

Author
Posts
#2645081

Tell us what you are trying to do?
I created a concert calendar on WordPress with toolset and elementor, I created artist pages where I inform the artists' concert dates. so that the dates of the concerts are in chronological order I created a value of the numeric meta field for each concert knowing that January 1st is the value 1 and December 31st is the value 365.
Is there a method for WordPress to know what day it is in digital meta and so that it can no longer automatically display concerts with the past date?

What is the link to your site?
hidden link

#2645201

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I am surprised that you are using a numeric field with the day-of-the-year rather than simply using a date field, in which case you could add a Query Filter to your View to only show posts with a date greater than or equal to TODAY.

In your case you will need to add some code to apply a condition to compare your numeric field with the current day of the year.

In PHP you can generate the current day of the year with

$current_day = date( 'z' ) +1;

So you can use the Views API to add a filter to the View in question, with the wpv_filter_query hook:

https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

Let us know if you need more help with that.

#2648463

Good morning,

I changed my numeric fields to date fields and I admit that it is much simpler. THANKS

I have another problem, I created a relationship between artists and festivals, I would like to know if it is possible to have an archive of the relationship between artist and festival?
On the artist pages I would like to automatically create an archive where the artist has been to a festival (2023, 2022, 2021...).

Sincerely
Arnaud

#2648465

I think I found the solution, thanks to the Query Filter in the view. You can do anything with this query filter, it's crazy!

Are relationship posts important? Can we delete them?

#2648605

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What you mean be relationship post - do you mean you added the post relationship filter in query filter section of your view?
If you can share screenshot of what post relationship you are taking about and tell me what exactly the issue is, after reviewing the information shared by you, I can guide you in the right direction.

#2649647

Good morning,

On my artist files: hidden link I have programmed future dates and past dates using the views, I would like to keep the archives of past concerts, how can I do this? Because when I update a festival by changing the dates if I remove the artist-festival relationship: everything disappears and if I keep it, the festival is removed from past dates and put on future dates while the artist does not is more programmed there.

I would like to create an archive of past festivals on the artist files.

Sincerely

#2649665

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I can see the section "Festivals passés" (past) and above that there is a section "Festivals à venir" (future).

Archive is different thing - do you want to create post type archive or you want to keep displaying those posts as archive on the page you shared.

I do not get idea yet what you mean when you change dates what happens. Can you please share step information with simple test post where I should change the date and experience the issue you see and tell me what is your expected result.

I need admin access details as well to review your structure.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.