get_the_time
-
Hi i have used your code and i have added excerpt and time function
add_action('telegram_parse','telegramcustom_parse', 10, 2); function telegramcustom_parse( $telegram_user_id, $text ) { $plugin_post_id = telegram_getid( $telegram_user_id ); if ( !$plugin_post_id ) { return; } if ( $text == '/latestnews') { $args = array( 'numberposts' => '5' ); $recent_posts = wp_get_recent_posts($args); $return_message = ''; foreach( $recent_posts as $recent ){ $return_message .= '['.$recent["post_title"].']('.get_permalink($recent["ID"]).')'. PHP_EOL .'Posted on: '.get_the_time('F jS, Y g: ia') .PHP_EOL .PHP_EOL .get_the_excerpt($recent["ID"]) .PHP_EOL .PHP_EOL; } wp_reset_query(); telegram_sendmessage( $telegram_user_id, $return_message); } return; }
Problem is that get_the_time report of each post the date of last one posted not different time with each post, where i do the mistake?
i explain better if do a new post all the post pick the data of the new post
Thanks
Jack
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘get_the_time’ is closed to new replies.