WordPress Website Name (say) = “German Philosophy Politics & Economics”
I want to return “My German Site”
I have tried the following :
<?php
$myvalue = bloginfo('name');
$arr = explode(' ',trim($myvalue));
$var = $arr[0];
echo "My ".$var." Site";
?>
but it returns “German My Site”
not “My German Site”
Any ideas ?
if in doubt, read the codex chapter for the function you are working with: http://codex.wordpress.org/Function_Reference/bloginfo
which points to the use of
get_bloginfo()
if you need to use the value in php string manipulations.