• haye321

    (@haye321)


    I accidently deleted the register and logout code for my website. Can anyone post the code so that I can insert it back into my site. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • sarekofvulcan

    (@sarekofvulcan)

    This what you had in mind?

    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
    <?php else : ?>
    
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <?php if ( $user_ID ) : ?>
    
    <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>">Logout &raquo;</a></p>
    
    <?php else : ?>
    
    <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
    <label for="author"><small>Name <?php if ($req) _e('(required)'); ?></small></label></p>
    
    <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
    <label for="email"><small>Mail (will not be published) <?php if ($req) _e('(required)'); ?></small></label></p>
    
    <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    <label for="url"><small>Website</small></label></p>
    
    <?php endif; ?>
    Thread Starter haye321

    (@haye321)

    I do not think so. The code that I lost was the code that usually appears on the side of the page and asks you to login or register. And then after you log in it show log out also. I am missing the register and logout code.

    Thread Starter haye321

    (@haye321)

    What happens is that I inserted the WP register hook but it is not displaying a register link.

    Xander

    (@xander)

    Download WP and cut the necessary code out of the relevant theme… hooks are for plugins (not what you are trying to do here).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Register and Logout Code’ is closed to new replies.