Support » Fixing WordPress » PHP / echo / a href problem

Viewing 5 replies - 1 through 5 (of 5 total)
  • Fiona,
    Try using single quotes to enclose what’s being echoed and double for the href – like this:
    echo '<li><a href="<? the_permalink() ?>">'.$title.'</a></li>';

    Thanks for that.

    That creates the link but not the permalink. It shows as ‘<? the_permalink() ?>’

    Any suggestions?

    Thank you



    Forum Moderator


    echo '<li><a href="' . get_the_permalink() . '"' . $title. '"</a></li>";

    Hi esmi,

    Get a white screen with your code. Strange. Can’t figure out what might me going amiss here.

    Any further suggestions greatly appreciated.



    The only way I have got this to work is by wrapping the ‘a href’ around the query like so:

    Not sure if this is semantically correct but it works. Is this acceptable?


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP / echo / a href problem’ is closed to new replies.