I have the following
<?php echo '<img src="/wp-content/themes/CAFC/images/cards/big/'.get_post_meta($post->ID, "bigcard", true).'" alt="'.the_title().'" />'; ?>
For some reason however my ‘the_title’ variable is appearing before my image when outputted as so…
UK Fuels Fuel Card
<img alt="" src="/wp-content/themes/CAFC/images/cards/big/ukfuels.png">
Can anybody give me an idea of where im going wrong?
This is because
the_title()
auto echoes the title. Tryget_the_title()
instead.Try to use as:
and, use this
$title
in place ofthe_title();
Use this instead:
I think it’s your browser. It changes the position of attributes for you. F. ex. Firefox can fix some HTML code according to standard.