You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The get_the_date behavior is to always return a date, so if a post ID not given to a get_the_date call and you're not in a context where posts can be obtained (i.e. is_date() ), then as a last resort get_the_date will use the post_date field from the wp_posts . So There needs to be Post IDS In this query. Just my brief idea from PHP overview.
Hi @scorpaanon
It's not due to the ID, it will automatically take the ID if it's in the loop.
The issue was due to one of your plugin called iWappPress which is changing the behavior of date and time functions by removing their filter. like add_filter('get_the_time', '__return_false');
function amp_date( $args=array() ) {
global $redux_builder_amp;
if ( 2 == $redux_builder_amp['ampforwp-post-date-format'] ) {
$args['format'] = 'traditional';
}
if ( (isset($args['format']) && $args['format'] == 'traditional') || 'time' == $args ) {
$post_date = esc_html( get_the_date() ) . ' '.esc_html( get_the_time());
} else {
$post_date = human_time_diff(
get_the_time('U', get_the_ID() ),
current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],
'ago');
}
$post_date = apply_filters('ampforwp_modify_post_date', $post_date);
if(isset($args['custom_format']) && $args['custom_format']!=""){
$post_date = date($args['custom_format'],get_the_time('U', get_the_ID() ));
}
if ( 'date' == $args || 'time' == $args ) {
echo $post_date .' ';
}
else
echo '
soultions??
echo get_the_date('F j, Y');
The get_the_date behavior is to always return a date, so if a post ID not given to a get_the_date call and you're not in a context where posts can be obtained (i.e. is_date() ), then as a last resort get_the_date will use the post_date field from the wp_posts . So There needs to be Post IDS In this query. Just my brief idea from PHP overview.
-KHII
#1864
The text was updated successfully, but these errors were encountered: