Can Someone Tell Me The Error With This PHP Code?

by 7 replies
9
Code:
<?php wpp_get_mostpopular("range=weekly&limit=6&thumbnail_width=90&thumbnail_height=60&stats_comments=0&post_html="<li>{thumb}<a href='{url}'>{text_title}</a></li>""); ?>
Where's the error?

I keep getting following error message:

"Parse error: syntax error, unexpected '>' in C:\xxxxx\xxxx\htdocs\xxx.com\wp-content\themes\xxx\single-videos.php on line 120"

Please Help!

Regards
#programming #code #error #php #php error #programming error
  • The error usually comes after adding the "post_html" parameter & this PHP function is on line 120.

    Regards
  • Nevermind, I am still looking hold on a min...
    • [1] reply
    • You can't put double quotes inside a pair of double quotes without escaping them (and same thing is true with single quotes). Try this instead...

      PHP Code:
      <?php wpp_get_mostpopular("range=weekly&limit=6&thumbnail_width=90&thumbnail_height=60&stats_comments=0&post_html='<li>{thumb}<a href=\'{url}\'>{text_title}</a></li>'"); ?>
      • [ 1 ] Thanks
      • [1] reply
  • Try adding a closing php to the code, before the html.
  • Nice job Brandon
  • Code:
    <?php wpp_get_mostpopular("range=weekly&limit=6&thumbnail_width=90&thumbnail_height=60&stats_comments=0&post_html=\"<li>{thumb}<a href='{url}'>{text_title}</a></li>\""); 
    ?>
    Escape the double quotes

Next Topics on Trending Feed