Problem:
In a single "member's profile" post, there is a custom date field "expire-date", which is created with Types plugin, you are going to get the "Year" value from "expire-date" field.
Solution:
You can try get the timestamp value of "expire-date" field with function get_post_meta(), for example:
$expire_date_timestamp = get_post_meta(get_the_ID(), 'wpcf-expire-date', true);
Then you can get the year value by timestamp using PHP function date, like this:
$expire_date_year = date('Y', $expire_date_timestamp);
Relevant Documentation:
http://php.net/manual/en/function.date.php
https://developer.wordpress.org/reference/functions/get_post_meta/
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 – 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 3 replies, has 2 voices.
Last updated by 5 years, 11 months ago.
Assisted by: Luo Yang.