Skip Navigation

[Resolved] Need to move a Movie CPT/View off a custom template after the date expires

This support ticket is created 5 years, 7 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by bryanC-2 5 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#1268769

Tell us what you are trying to do?

I want to take individual movies from CPT/View/Template I created here. hidden link under "Our Movies" tab and have the individual movie leave the template after the current date passes the custom field/slug 'date-movie-ends'. I don't want it to rely on the publish date, but rather the date the admin puts in the custom field.

Even better would be if I could have the individual movie times disappear after the movie time ends as well if possible.

Is there any documentation that you are following?

All I have found in forums is about Creds and this isn't a front page forms creation. This is a back form for the admin.

The Movie start date and the movie end date fields aren't actually used on the "Our Movies" tab on the front page, but rather for the individual movie page. Example here. hidden link above the title

Below are Dropbox Links to Views and templates I created for the URLs given.

For the individual movie page: hidden link
hidden link

For the Home Page "Our Movies" Tabbed Section: hidden link
hidden link

Separate Showtime section for both "Our Movies" and individual page.
hidden link

Custom fields, if you need them.
hidden link

Thanks for the help. I hope I am making sense.

Bryan

#1269115

Nigel
Supporter

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

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

Hi Bryan

I'm not really following your description of the issue.

If I visit your link at hidden link I can see that this is the WordPress blog page, i.e. it is showing an archive of standard posts.

It sounds like these have a custom fields for show times, and you want to exclude posts which have already passed.

From the page source it looks like you are generating this grid of movies using a View (or a custom archive).

So the solution would be to add a Query Filter for the date custom field, as described here: https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/

Note that these date fields are stored as timestamps (number of seconds since 1970), and so in a filter should be compared as numbers, which you could compare to NOW for example.

So that would exclude such films appearing in the grid of results.

Is that what you are aiming for?

#1271089

I've made some progress on this issue. With the reference material you have given me, I think I will work it out. If I continue to have a problem, I will open a new ticket.

Thanks
Bryan