Hi guys,
I’ve been looking into this one and unfortunately, the issue is that the Pop Up plugin currently accepts only direct URLs, which doesn’t include URL parameters like “?lang=en”.
It’s basically explained through this post by one of the developers:
https://premium.wpmudev.org/forums/topic/how-to-display-popup-in-a-specific-page#post-645332
I’m afraid I don’t know know a way around this except maybe with some custom JavaScript like noted here:
https://www.jquerybyexample.net/2012/06/get-url-parameters-using-jquery.html
Given that, I think something like this could work:
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 lang = getUrlParameter('lang');
if (lang == 'en') {
jQuery( 'div.visiblebox' ).hide();
}
});
</script>
<?php
}
}
add_action( 'wp_footer', 'popover_url_parameters' );
That could be added to your theme’s functions.php file or using this:
https://www.ads-software.com/plugins/code-snippets/
That particular snippet should hide the popover if the “lang” parameter is equal to “en”.
The issue though, is that you’d need to customize that sort of code to work with your particular site.
Does that sound viable to you?
Cheers,
David