URL Parameter
-
Hello,
Thank you for this plugin. It is working great with one exception – I’m trying to use the Not on Specific URL parameter to hide the following pages:
https://smartershift.com/energymix/register/?action=registeruser&subscription=1
https://smartershift.com/energymix/register/?action=registeruser&subscription=2However my popup still shows. I saw in other threads that there seems to be an issue with parameters in URLs, so I tried the following script in my functions.php
function popover_url_parameters() { if ( wp_script_is( 'jquery', 'done' ) ) { ?> <script type="text/javascript"> // getUrlParameter() function from https://www.jquerybyexample.net/2012/06/get-url-parameters-using-jquery.html function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam) return sParameterName[1]; } } jQuery( document ).ready(function() { var sub = getUrlParameter('action); if (sub == 'registeruser&subscription=1') { jQuery( 'div.visiblebox' ).hide(); } }); </script> <?php } } add_action( 'wp_footer', 'popover_url_parameters' );
I’ve tried variances of the ‘registeruser&subscription=1’ line with variables like ‘registeruser’ ‘registeruser&subscription’ & ‘registeruser&subscription=’ but none of these items will work.
Do you have any ideas?
- The topic ‘URL Parameter’ is closed to new replies.