wp recent post
-
Hi i have create the custom plugin as u suggest adding the following code:
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’) {
?>
- <?php
- ‘ . $recent[“post_title”].’
$args = array( ‘numberposts’ => ‘4’ );
$recent_posts = wp_get_recent_posts($args);
foreach( $recent_posts as $recent ){
echo ‘‘;
}
wp_reset_query();?>
<?php
telegram_sendmessage( $telegram_user_id, get_the_title($recent_posts));
}return;
}?>
but when i try on telegram he retrive only latest post not 4 latest posts, where is my mistake? is it possible to add the permalink ? or make the entire process internally in your command menu? if yes how?
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp recent post’ is closed to new replies.