Skip Navigation

[Resolved] Help with displaying post expiration 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 5 replies, has 2 voices.

Last updated by Minesh 1 year, 5 months ago.

Assisted by: Minesh.

Author
Posts
#2629263

On this support thread (https://toolset.com/forums/topic/displaying-_cred_post_expiration_time-for-user/) I found the shortcode to display a post's expiration date: [cred-post-expiration format="m/d/Y"]

This works when a post has an expiration date. However, my current post type only has expiration dates for some posts. That's where the problem is - when I use that shortcode for a post that doesn't have an expiration date, it displays the current date, making it look like it's about to expire when it's not. Is there any way to only show an expiration date, or say no expiration if there isn't one set, something like that?

Thanks

#2629349

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Can you please tell me where and how you are displaying the post expiration shortcode on your post/page. Maybe you can share few screenshot of that.

In addition to that - Could you please send me debug information that will help us to investigate your issue.
=> https://toolset.com/faq/provide-debug-information-faster-support/

#2629669
Screen Shot 2023-08-02 at 10.48.24 AM.png
Screen Shot 2023-08-02 at 10.44.11 AM.png
Screen Shot 2023-08-02 at 10.44.27 AM.png
Screen Shot 2023-08-02 at 10.44.43 AM.png

I'm using the shortcode in the content template of a query view (first screenshot). The second screenshots show the results of the view with the expiration date next to the Read More button. The first result, "A 52-page guide for landowners considering leasing their land for farming from Land For..." has an expiration date set for 8/10, and shows that correctly. All other results (including "A Brief Introduction to Agricultural Co-ops from OSU" have no set expiration date). The next two screenshots show the backend expiration status of both posts.

#2630335

Minesh
Supporter

Languages: English (English )

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

Can you please share problem URL of your view and admin access details. I will have to check if it stores the current date as post expiration date or not.

*** 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.

#2631477

One thing I forgot to mention - the site is behind a coming soon page - you'll be able to see it once you login in with the credentials I supplied above.

#2631673

Minesh
Supporter

Languages: English (English )

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

Can you please check now: hidden link

I've added the conditional statement to display the post expiration date to your view.
=> hidden link

 [wpv-conditional if="( '[wpv-post-field name='_cred_post_expiration_time']' ne '' ) AND ( '[wpv-post-field name='_cred_post_expiration_time']' ne '0' )"]
  	  	[cred-post-expiration format="m/d/Y"]
  [/wpv-conditional]

Can you please confirm it works as expected now.

#2631759

This worked perfectly - thanks for the great support.