Reputation: 31
How to echo this:
echo '<link rel="stylesheet" type="text/css" href="<?php echo get_bloginfo('template_url');?>/tryme.css">';
Am I doing right? It gets an error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'
Please help. THank you.
Upvotes: 3
Views: 4859
Reputation: 826
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('template_url') . '/tryme.css">';
echo
is a function, which prints its argument. You can actually call echo
like this: echo("hello");
, which is syntactically identical to echo "hello";
if you are calling echo
, you are already in php mode (ie: there's an open <?php
somewhere before your echo
call), so there's no need to enter php mode again for the get_bloginfo
call. get_bloginfo
returns a string, so you can just concatenate its output with the rest of your echo
parameter.
Upvotes: 8