how i change login mode from theme base to other plugin wordpress

111 Views Asked by At

this is my theme login i want to chang it to other plugin whiout effecting the theme i want help

> <?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 } ?>
1

There are 1 best solutions below

0
omukiguy On

To make a plugin is simple. Using this code, create a folder named whatever-name-you-want and create a file called whatever-name-you-want.php. Inside that file add this code. You can make changes to the names in the commented code.

Then go to plugins in your admin section and click activate the magic plugin or whatever name you have called it.

/**
 * 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 
}