php - bloginfo() executing out of order? -


i have following code in wordpress header.php file. printing dynamic title in html:

<title>     <?php if (is_page_template('page-home.php')){     echo 'home - ' .      bloginfo('name');     } </title> 

the rendered html looks this:

<title>my cool bloghome - </title> 

i believe should this:

<title>home - cool blog</title> 

my question is: why echo , bloginfo() execution seem reversed? echoed text seems printing after bloginfo().

try using get_bloginfo instead.

bloginfo() runs, , echos out when it's called. get_bloginfo() returns value, can include in echo statement.

currently, bloginfo printing out value out it's called; echo statement echoed out.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -