• Resolved HorrorUK

    (@horroruk)


    Hi,

    I have a plugin that doesn’t quite do what I want. If a user isn’t logged in, it tells them they need to log in, but doesn’t give a link, so I’d like to add the link.

    This is the original code:

    elseif (!is_user_logged_in()) echo "<p>If you want to add yourself to this blog, please log in.</p>";

    I tried the following, but it gave a 500 error:

    elseif (!is_user_logged_in()) echo "<p>If you want to add yourself to this blog, please <a target="_blank" href="/">log in</a> or <a target="_blank" href="/wp-signup.php">sign up to the network</a> then refresh this page.</p>";

    Is there a way in which I can do this?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m pretty sure you could do this by changing the ” to ‘ for the echo:

    elseif (!is_user_logged_in()) echo '<p>If you want to add yourself to this blog, please <a target="_blank" href="/">log in</a> or <a target="_blank" href="/wp-signup.php">sign up to the network</a> then refresh this page.</p>';

    Thread Starter HorrorUK

    (@horroruk)

    Thanks bythegram, that did the job perfectly.

    Sometimes it is better to look for the simple solution first ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding URL code within an echo command’ is closed to new replies.