Parse Error: Please Help!

Can someone please help me clean this up? I’m getting the following error:

Parse error: syntax error, unexpected ‘<’ in /home1/parksmkt/public_html/athleteswhotweet/wp-content/plugins/wp-php-widget/wp-php-widget.php(52) : eval()'d code on line 9

On:

<ul class="wp-tag-cloud">
<?php 
//list all tags that are assigned to posts 
  $taxonomy = 'post_tag'; 
  $terms = get_terms( $taxonomy, 'orderby=count&order=DESC&number=10' ); 
  if ($terms) { 
    foreach($terms as $term) { 
      if ($term->count > 0) { 
        echo '<li>' . '<a href="' . esc_attr(get_term_link($term, $taxonomy)) . '" title="' . sprintf( __( "% players on Twitter" ), $term->name ) . '" ' . '>' . $term->name.'</a><span> ' . $term->count . </span></li> '; 
      } 
    } 
  } 
?>
</ul>

How do I make this valid?

Thanks,

Jon

The following line is the issue

echo '<li>' . '<a href="' . esc_attr(get_term_link($term, $taxonomy)) . '" title="' . sprintf( __( "% players on Twitter" ), $term->name ) . '" ' . '>' . $term->name.'</a><span> ' . $term->count . </span></li> ;

Simply replace it with the below and it will work fine

echo '<li>' . '<a href="' . esc_attr(get_term_link($term, $taxonomy)) . '" title="' . sprintf( __( "% players on Twitter" ), $term->name ) . '" ' . '>' . $term->name.'</a><span> ' . $term->count . '</span></li>';

Switch line 9 to:


echo '<li>' . '<a href="' . esc_attr(get_term_link($term, $taxonomy)) . '" title="' . sprintf( __( "% players on Twitter" ), $term->name ) . '">' . $term->name.'</a><span>' . $term->count . '</span></li>'; 

Should do the trick…

Thank you! Looks great! However I still have an issue… for some reason, the

( "% players on Twitter" )

part is not working properly… It should be showing other tag name and “players” on twitter in the alt, but it is not working properly,

In addition, the “count” is not showing to the right of the <span> portion is not showing. It appears in the HTML, but for some reason the CSS background color does not appear to be loading.

I think something in the PHP is creating these issues… can someone please advise?

So i got the issue with the alt tags fixed, but I still can’t figure out what’s causing the count to not display properly (between the spans)…