我如何将登录模式从主题库更改为其他插件wordpress

问题描述 投票:0回答:1

这是我的主题登录名,我想将其更改为其他影响主题的插件我需要帮助

> <?php if(get_theme_mod('header_login_btn', true ) &&
> !is_user_logged_in()){ 
>                                           $header_login_btn_text = get_theme_mod('header_login_btn_text', 'Login');
>                                           $header_reg_btn_text = get_theme_mod('header_reg_btn_text', 'Sign Up');
>                                           ?>
>                                       <div class="skillate-header-login d-inline-block ml-4">
>                                           <div class="header-login-wrap">
>                                               <a data-toggle="modal" href="#modal-login">
>                                                   <?php echo esc_html($header_login_btn_text); ?>
>                                               </a>
>                                               <a data-toggle="modal" href="#modal-registration">
>                                                   <?php echo esc_html($header_reg_btn_text); ?>
>                                               </a>
>                                           </div>
>                                       </div>
>                                       <?php } ?>
wordpress authentication wordpress-theming custom-wordpress-pages login-script
1个回答
0
投票

制作插件很简单。使用此代码,创建一个名为whatever-name-you-want的文件夹并创建一个名为whatever-name-you-want.php的文件。在该文件内添加此代码。您可以在注释的代码中更改名称。

然后转到管理部分中的插件,然后单击激活魔术插件或您叫它的任何名称。

/**
 * Plugin Name: Magic Plugin
 * Description: Magic Plugin performs magic. 
 * Plugin URI: http://example.com/magic-plugin
 * Version: 2.3
 * Author: Mr. Magic 
 * Author URI: http://example.com/
 * Text Domain: magic-plugin 
 * 
 * @package Magic Plugin
 */

if(get_theme_mod('header_login_btn', true ) && !is_user_logged_in()){ 
    $header_login_btn_text = get_theme_mod('header_login_btn_text', 'Login');
    $header_reg_btn_text = get_theme_mod('header_reg_btn_text', 'Sign Up');
    ?>
    <div class="skillate-header-login d-inline-block ml-4">
        <div class="header-login-wrap">
            <a data-toggle="modal" href="#modal-login">
                <?php echo esc_html($header_login_btn_text); ?>
            </a>
            <a data-toggle="modal" href="#modal-registration">
                <?php echo esc_html($header_reg_btn_text); ?>
            </a>
        </div>
    </div>
<?php 
} 
© www.soinside.com 2019 - 2024. All rights reserved.