• Resolved clairedj

    (@clairedj)


    I want to put a login form in my sidebar. I have tried MiniMeta as well as others and found that they did not work on my blog.

    This is the plugin I have found works:
    https://www.wpdesigner.com/2007/07/14/my-account-widget/
    It appears that this plugin is no longer being supported by its author.

    The problem I am running into is that the “Anybody can register” option needs to be turned on for the login form to appear, but I do not want to have this option available.

    Can somebody please tell me what I need to change in the PHP so that the form appears even if the registration option is turned off?

    Here is the snippet of code that I believe needs to be changed:

    <?php elseif ( get_option(‘users_can_register’) ) : ?>

    <h2>Identification</h2>

    • <form action=”<?php bloginfo(‘url’) ?>/wp-login.php” method=”post”>
      <p>
      <label for=”log”><input type=”text” name=”log” id=”log” value=”<?php echo wp_specialchars(stripslashes($user_login), 1) ?>” size=”22″ /> User</label>
      <label for=”pwd”><input type=”password” name=”pwd” id=”pwd” size=”22″ /> Password</label>
      <input type=”submit” name=”submit” value=”Send” class=”button” />
      <label for=”rememberme”><input name=”rememberme” id=”rememberme” type=”checkbox” checked=”checked” value=”forever” /> Remember me</label>
      </p>
      <input type=”hidden” name=”redirect_to” value=”<?php echo $_SERVER[‘REQUEST_URI’]; ?>”/>
      </form>
    • /wp-register.php”>Register
    • /wp-login.php?action=lostpassword”>Recover password

    <?php endif // get_option(‘users_can_register’) ?>

    Full code can be found here: https://www.wpdesigner.com/wp-content/files/codes/sidebar_login.txt

Viewing 1 replies (of 1 total)
  • Get rid of this line
    <?php elseif ( get_option(‘users_can_register’) ) : ?>
    and this line at the end
    <l/i>/wp-register.php”>Register</l/i>
    [forward slashes mine]

    The final endif should close it all out for you. This should let the log-in form appear, without the registration link.

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin being used only appears if user registration is on. Need help with PHP’ is closed to new replies.