Title: WPML / Multiple popups
Last modified: December 30, 2020

---

# WPML / Multiple popups

 *  Resolved [schnellbert](https://wordpress.org/support/users/schnellbert/)
 * (@schnellbert)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/wpml-multiple-popups/)
 * I’m trying to make this plugin work with WPML, showing different popups for sites
   in different languages.
 * For this I have enabled the WPML option to set a language cookie, as outlined
   here:
 * [https://wpml.org/documentation/getting-started-guide/language-setup/enabling-language-cookie-to-support-ajax-filtering/#:~:text=To%20enable%20language%20information%20for,language%20filtering%20for%20AJAX%20option](https://wpml.org/documentation/getting-started-guide/language-setup/enabling-language-cookie-to-support-ajax-filtering/#:~:text=To%20enable%20language%20information%20for,language%20filtering%20for%20AJAX%20option).
 * I made sure that the cookie is indeed present.
 * Now I have created multiple popups with “Display Rule” set to “Everywhere”.
 * I left the “Popup Condition” set to “Select role” for all of them.
 * Then I use this code in the “Opening events” part of custom JS section of the
   popup:
 *     ```
       alert('english popup');
       function getCookieValue(a) {
           var b = document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)');
           return b ? b.pop() : '';
       }
       return (getCookieValue('wp-wpml_current_language') == 'de') ? false : true;
       ```
   
 * The “alert()” is just for debugging purposes.
 * I’ve added this JS code to all the popups.
 * Now I would have expected that ALL popups load on ALL pages, run this JS code
   and then, depending on whether it returns true or false, the correct popup gets
   displayed.
 * However, this is not the case. Only one popup is loaded. And it’s a different
   popup on different subpages – very weird.
 * When I inspect the html elements and search for ones beginning with “sg-popup-
   content-wrapper” I always see only one element. Shouldn’t there be multiple elements
   beginning with “sg-popup-content-wrapper…” in order for this to work?
 * Am I missing something or is this a bug?

Viewing 1 replies (of 1 total)

 *  [Sygnoos](https://wordpress.org/support/users/sygnoos/)
 * (@sygnoos)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/wpml-multiple-popups/#post-13865386)
 * Hello [@schnellbert](https://wordpress.org/support/users/schnellbert/),
    Sorry
   for the delayed answer.
 * Could you please check this article?
 * [How to Use Popup Builder with WPML?](https://help.popup-builder.com/en/article/how-to-use-popup-builder-with-wpml-1ejtpj0/)
 * In this case, you’ll need to create a popup for each language accordingly, and
   when you select Display Rule -> Everywhere it will mean the popup will load for
   all ‘de’ pages.
 * Hope that helps.

Viewing 1 replies (of 1 total)

The topic ‘WPML / Multiple popups’ is closed to new replies.

 * ![](https://ps.w.org/popup-builder/assets/icon-128x128.gif?rev=2698840)
 * [Popup Builder - Create highly converting, mobile friendly marketing popups.](https://wordpress.org/plugins/popup-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/popup-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/popup-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/popup-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/popup-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/popup-builder/reviews/)

## Tags

 * [cookies](https://wordpress.org/support/topic-tag/cookies/)
 * [language](https://wordpress.org/support/topic-tag/language/)
 * [multiple popups](https://wordpress.org/support/topic-tag/multiple-popups/)

 * 1 reply
 * 2 participants
 * Last reply from: [Sygnoos](https://wordpress.org/support/users/sygnoos/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/wpml-multiple-popups/#post-13865386)
 * Status: resolved