Alternate between modal texts on same URL depending on action to URL

Our site uses a combination of WordPress and Discourse.

I need to bring up a different modal text depending on how the user gets to the /join url. For example, we have it set up such that if a user clicks +New Question in the navbar (or any type of action such as ‘Reply’, ‘Like’ in Discourse), they will receive Modal 1. I need to be able to show the user Modal 2 if they click ‘Join Us’.

Read More

The modal currently exists as a Javascript in the WordPress(‘Edit Page’), but also as a shortcode in our plugins folder (which I don’t think is being loaded, though I could be wrong).

[urlparameter parameter="direct" value="true" truecheck="false"][raw]<script type="text/javascript">$( document ).ready(function() 

My thinking is that Modal 1/2 would show depending on the prior action leading to the /join, i.e. clicking on +New Question or ‘Join Us’.

Could someone please advise? Thanks!

EDIT:
Just looked at our PRODUCTION file and it appears the shortcode for the modal only appears in the DEVELOPMENT file, therefore I feel that all the behaviour for the modal pop up only occurs in the PRODUCTION WordPress(‘Edit Page’) side of things.

Related posts