Hi, i’m a beginner in PHP and Wordpress and i would appreciate help on project i’m working on.
Currently i am using the below code to: query a specific post and then echo it’s expiration date (expiration date is set through a plugin) in a wordpress site:
<?php $postid = 3823; $date_format = __( 'd / m / Y' ); $expiration_date = get_post_meta( $postid, '_expiration_date', true); echo date_i18n( $date_format, strtotime( $expiration_date ) ); ?>This is working fine. What i would like it to do is:
- I will have 2 posts, 1 published and one scheduled
- Query both posts, check which is publiched and echo it’s expiration date
Thanks,
Charis