get_the_date
-
Dear,
i am trying to get the date in my wp bakery grid builder.
so far i have created a shortcode which functions but it echos back te page date.
<?php function dotavatiar_function( $format = '', $post = null ) { $post = get_post( $post ); if ( ! $post ) { return false; } $_format = ! empty( $format ) ? $format : get_option( 'date_format' ); $the_date = get_post_time( $_format, false, $post, true ); /** * Filters the date a post was published. * * @since 3.0.0 * * @param string $the_date The formatted date. * @param string $format PHP date format. * @param int|WP_Post $post The post object or ID. */ return apply_filters( 'get_the_date', $the_date, $format, $post ); }; add_shortcode('dotiavatar', 'dotavatiar_function');I want to get the posts-date. This function i have written above as i said echos the page date not the posts.
Thank you
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘get_the_date’ is closed to new replies.