Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

jralston on "PHP echo href problem"

$
0
0

I am having a heck of time trying to echo a link. Here is my code:

if ( ! is_user_logged_in() ) { // Display WordPress login form:
    $args = array(
        'form_id' => 'loginform-custom',
        'label_username' => __( 'Username custom text' ),
        'label_password' => __( 'Password custom text' ),
        'label_remember' => __( 'Remember Me custom text' ),
        'label_log_in' => __( 'Log In custom text' ),
        'remember' => true
    );
    wp_login_form( $args );
    wp_register('You must ', ' and login in order to post on this forum.');
    echo '<a href="' . wp_lostpassword_url() . '">Lost Password</a>';
    $url = wp_lostpassword_url('/');
    echo "<a href=$url>Click here</a>";
} else { // If logged in:

    echo " Welcome! You are logged in.  |   ";
wp_loginout( home_url() ); // Display "Log Out" link.
}

As you can see I've tried 2 ways of displaying the href and neither are working. I have tried many different ways and none are displaying the url as clickable. I can echo the correct url and the "Lost Password" words - but it's not clickable. I cannot get the href part of it to work. It needs to be within the if/else statement. Suggestions please?


Viewing all articles
Browse latest Browse all 8245

Trending Articles