This topic has 3 replies, 3 voices, and was last updated 8 years by ahmadfaiz11.

  • Author
  • #49417
     Mistertoy
    Participant

    Hello, i want redirect the not logged users to modal window register
    for example:
    anyone who visits the site and want to see some profile is routed modal window and not to the select membership page.

    picture example

    thankyou.

    Attachments:
    You must be logged in to view attached files.
    #49835
     Mistertoy
    Participant

    Hello, anyone who can help?

    #50248
     Andrei
    Moderator

    Add the following code to your functions.php file:

    COPY CODE
    
    
    if(!is_user_logged_in()){
        function custom_pmpro_url_redirect(){
            return home_url().'#register';
        }
        add_action('kleo_pmpro_url_redirect', 'custom_pmpro_url_redirect');
        add_action('kleo_pmpro_home_redirect', 'custom_pmpro_url_redirect');
    
        function custom_pmpro_url_redirect_popup_reveal(){
            echo '<script> document.addEventListener("DOMContentLoaded", function(event) { var id = window.location.hash.substring(1); if(id == "register"){ jQuery(\'[data-reveal-id="register_panel"]\').click(); } }); </script>';
        }
        add_action('wp_footer', 'custom_pmpro_url_redirect_popup_reveal', 100);
    }
    

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #127177
     ahmadfaiz11
    Participant

    Hi..

    This is still working?

    I try this but not working…

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?