i am using below code to display the latest post from sub-domain to domain–Here is the code i am using —
I need to show the limit characters of post_title like to 30
Here is the code..
function render_my_recent_posts( $numberposts = 5 ) { ?>
<ul>
<?php
$args = array( 'numberposts' => '5' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ) {
echo '<li><img src="/images/default-user-avatar-3.jpg"><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"].'</a> </li> ';
}
?>
</ul><?php
}
Any help ?
Thankyou
Would
substr($recent["post_title"],0,30)do what you need?