I am using wordpress and I want to show upto 15 characters for my post title.
I have used this:
$myposts = get_posts('numberposts=11&offset=0'); foreach($myposts as $post) : substr(the_title(), 0, 15); endforeach;
I have removed the PHP tags to look properly here…basically the code is marked as bold.
but it is not working.
Any suggestion is highly appreciable.
the_title()
outputs the title directly instead of returning it. Useget_the_title()
instead.i prefer this one