Hi! My first post… I want to thanks all the community and roots contributors! I love you all!
I was in need of giving the result of roots_title() to a $var.
I discovered that since the result of roots_title() was the_title(), I couldn’t store it since it is already printing the result.
I’ve noticed that in page-header.php we have ‘echo roots_title()’. As far I can imagine the echo is needed to print the result of the function. Why it is there if the function already prints its result?
Shouldn’t be the roots_title() function returning the result such as ‘return get_the_title()’ instead of the_title() [this is in the last else statement of title.php], and then if we need to print we use echo (for ex. in page-header.php), but if we need to store it in a $var we can use $var = roots_title(); ?
Thanks for pointing this out, it’s a good spot. Nothing should be echoed though, so you can’t just change the_title to get_the_title. The lines with printf_e and single_cat_title would all need to be changed too.