I want to get the first letter of a post title in wordpress, then use substr
on it to get the first letter by using this snippet but it still displays the full word.
<?php
$get_title = the_title();
$ltr_group = mb_substr($get_title, 0, 1);
echo $ltr_group;
?>
Please try this code maybe useful for you:
It looks like your the_title() function may not be returning a string I would start by adding this to your code to ensure that the $get-title variable is in fact a string.
If that doesn't work maybe try: