Page 1 of 1

Firefox Multiple Link Tags Problem

Posted: Fri Sep 10, 2010 12:00 pm
by HiddenS3crets
I have a code snippet that looks like this:
[text]<div class='social_block'>
<a href='twitter.com...'>
<img src='twitter_image...' />
<p><? echo get_num_followers(); ?></p>
<p>followers</p>
</a>
</div>

<div class='social_block'>
<a href='facebook.com...'>
<img src='facebook_image...' />
<p><? echo get_num_likes(); ?></p>
<p>likes</p>
</a>
</div>[/text]
* get_num_followers() and get_num_likes() both return a number

The issue is that (and I've only noticed this in firefox so far) each line inside the <a> get's wrapped inside it's own <a> tag so the rendered source looks like this:
[text]<div class='social_block'>
<a href='twitter.com...'><img ... /></a>
<p><a href='twitter.com...'>150</a></p>
<p><a href='twitter.com...'>followers</a></p>
</div>[/text]

What's interesting, though, is that if I replace the PHP code with just a number, it renders on the page ok
[text]i.e. i replaced
<p><? get_num_followers(); ?></p>
with
<p>150</p>[/text]
I cannot figure out why the PHP code is causing rendering issues here... any ideas on a fix for this?