duanjuan3931 2016-05-03 14:28
浏览 26

自定义WordPress登录

I have a custom WordPress login Form and when I enter correct details it adds ?login=failed to the url but if I try login again with the wrong credentials it then becomes ?login=failed?login=failed is there anyway to reset this.

<?php if (isset($_GET['login']) && $_GET['login'] == 'failed') { ?>
    <div style="background-color: #5ab547; color: white; text-align: center; padding: 13px 0px;">
        Invalid Username or Password, Please try again.
    </div>
<?php } ?>




<div class="loginForm dark">
      <?php
         if ( ! is_user_logged_in() ) { // Display WordPress login form:

            if(isset($_GET['redirecturl']) &&  $_GET['redirecturl'] == 'followup') {
                $redirectto = "http://yaregroup.com".$_GET['url'];
                    $args = array(
                        'redirect' => $redirectto, 
                        'form_id' => 'loginform-custom',
                        'label_username' => __( 'Email Address' ),
                        'label_password' => __( 'Password' ),
                        'label_remember' => __( 'Remember Me' ),
                        'label_log_in' => __( 'Log In' ),
                        'remember' => true
                    );

            } else {

                    $args = array(
                        'redirect' => 'http://yaregroup.com/bankrollNew/dashboard/', 
                        'form_id' => 'loginform-custom',
                        'label_username' => __( 'Email Address' ),
                        'label_password' => __( 'Password' ),
                        'label_remember' => __( 'Remember Me' ),
                        'label_log_in' => __( 'Log In' ),
                        'remember' => true
                    );
            }

             wp_login_form( $args );
         } else { // If logged in:
            echo '<div class="btn btnCommand">';
             wp_loginout( home_url() ); // Display "Log Out" link.
             echo '</div>';
             wp_register('', ''); // Display "Site Admin" link.
         }
         ?>
      <div id="forgot">
      <a href="http://yaregroup.com/bankrollNew/passreset/">Forgot Username or Password</a>
      </div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
    • ¥15 MATLAB中streamslice问题
    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端
    • ¥15 基于PLC的三轴机械手程序