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
Post a Comment