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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With