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 ‘http://domain.com/<? the_permalink() ?>’

    Any suggestions?

    Thank you

    esmi

    (@esmi)

    Forum Moderator

    Try:

    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.

    Thanks

    Hmmmmm,

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

    http://paste-it.net/public/a8b45b2/

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

    Thanks

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