• HOME
  • KNOWLEDGE BASE
  • FAQ
  • CONTACT US
  • HOME
  • KNOWLEDGE BASE
  • FAQ
  • CONTACT US
home/Knowledge Base/How To/How to change the link of an existing button to Digits Modal or Page

How to change the link of an existing button to Digits Modal or Page

This is generally needed when your theme does not handle login/signup buttons from menu links and don’t have an option to change the links aswell. With this you can overwrite their button to trigger our popup or page.

The easiest method to add the code when you’re not using child theme is to use Code Snippets WordPress Plugin or else if you’re comfortable with using child theme then the best option is to use the child theme. Both of these methods are update proof, so you won’t be losing changes when you update the plugins.

To trigger Modal / Pop-Up

Below is the simple line of code you’ll need to add if you want to trigger the modal/popup

jQuery(document).ready(function(){
   jQuery('.class').addClass('digits-login-modal').attr('type',1);
});

Don’t forget to change the text marked in red according to your needs

.class represents the class of the button you want to make the change

If using Code Snippet Plugin then use the below code

add_action( 'wp_head', function () { ?>
<script>

jQuery(document).ready(function(){
   jQuery('.class').addClass('digits-login-modal').attr('type',1);
});

</script>
<?php } );

Don’t forget to change the text marked in red according to your needs

.class represents the class of the button you want to make the change

type value 1 represents the type of form you want to trigger, the values of different types are given below

Login/Sign-Up: 1
Registration
: 2
Forgot Password: 3
Only Login: 4

To trigger Page

If you want to trigger the page instead then you can use the below code

 jQuery(document).ready(function () {
    jQuery('.class').addClass('open_link').attr({'type': 1, 'href': '?login=true&type=1'});
    jQuery(document).on('click', '.open_link', function (e) {
        location.href = jQuery(this).attr('href');
    });
}); 

Don’t forget to change the text marked in red according to your needs

.class represents the class of the button you want to make the change

If using Code Snippet Plugin then use the below code

add_action( 'wp_head', function () { ?><script>

jQuery(document).ready(function () {
    jQuery('.class').addClass('open_link').attr({'type': 1, 'href': '?login=true&type=1'});
    jQuery(document).on('click', '.open_link', function (e) {
        location.href = jQuery(this).attr('href');
    });
}); 

</script>
<?php } );

Don’t forget to change the text marked in red according to your needs

.class represents the class of the button you want to make the change

type value 1 represents the type of form you want to trigger, the values of different types are given below

Login/Sign-Up: 1
Registration
: 2
Forgot Password: 3
Only Login: 4

Direct Links

Login/Registration: yourwebsite.com/?login=true
Registration:
yourwebsite.com/?login=true&type=register
Forgot Password: yourwebsite.com/?login=true&type=forgot-password
Only Login: yourwebsite.com/?login=true&type=login

NOTE: If you use this to change your existing theme modal with ours then adding this will trigger two modals (your existing one and ours), so you will have to use CSS to hide that existing modal.

Builder

The above-mentioned steps even work with builder once you set default pages and modal for the ones you need in builder settings.

Was this helpful?

15 Yes  34 No
How To
  • How to change the link of an existing button to Digits Modal or Page
  • How to place Digits form on any page
  • How to let User Edit their Account Phone Number
  • Plugin text translation
  • How To Trigger Modal From A Custom Button
  • How to use Digits with Ultimate Membership Pro Forms
View All 9  
Categories
  • Addons
  • Common Errors
  • Gateway Setup
  • Getting Started
  • How To
  • Page/Popup Builder

  How To Edit/Customize Digits Login Form

    • Made with ❤ by Humans on 🌎