Is there a way native way in wordpress to make uppercase the first letter of the first word of the scentence / the_title of the post?
If not, how do I do it in php, while it is wrapped in a <a></a> tag?
Here is the full line of code.
<a href="<?php the_permalink(); ?>"><?php ucfirst(the_title());?></a>
As you see, I have tried ucfirst, but it does not work. The other thing that I tried is:
<?php
$temp_title = the_title();
$final_title = ucfirst($temp_title);
?>
<a href="<?php the_permalink(); ?>"><?php echo $final_title;?></a>
ucfirst()returns a string. You need toechothe value returned fromucfirst().Furthermore, the WordPress function
the_title()prints the title directly, rather than returning it as a string. Useget_the_title()instead.