Quantcast
Viewing all articles
Browse latest Browse all 512573

wp_Query date format

Replies: 1

I have a metabox as follows –

array(
       'id'   => 'released',
       'name' => __( 'Release Date', 'textdomain' ),
       'type' => 'date',
   ),

Which outputs the date in the format of Y-m-d even though I have the date format set as d-m-Y in admin ui. I output as follows –

<?php $rel = get_post_meta( get_the_ID(), "released", true ); ?>
<?php echo $rel; ?>

My 2 questions are –
How would I output the date format as d-m-Y
And how would I WP_Query to just list the posts of a designated year like 1980.

Thanks in advance
Steven


Viewing all articles
Browse latest Browse all 512573

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>