WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Syntax Error Unexpected T_String In String Concatination (3 posts)

  1. avil
    Member
    Posted 2 years ago #

    The syntax error Iam getting while editing the code in my theme's functions.php is on line 88, where I added a new line of code ..

    Here's the code :

    $popular .= '<a href="<?php the_permalink(); ?>"><img src="<?php echo bloginfo('template_url'); ?>/timthumbs.php?src=<?php echo catch_that_image() ?>&w=200&h=100&zc=3&q=100" alt="<?php the_title(); ?>" class="footer-thumb" width="200px" height="100px" /></a>'

    Iam unable to figure out the correct escaping required ..

    Kindly help ..

  2. SpaceDogDeveloper
    Member
    Posted 2 years ago #

    You have php tags inside a variable. You can't have more php tags in there.

    $popular .= '<a href="><?php somecode(); ?>"> <--- wrong
    $popular .= '<a href="' . somecode() . '"> <---- correct

    http://php.net/manual/en/language.operators.string.php

  3. avil
    Member
    Posted 2 years ago #

    Thanks SpaceDogDeveloper, got that working.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.