Title: Positioning bug   solution
Last modified: August 30, 2016

---

# Positioning bug solution

 *  Resolved [invik](https://wordpress.org/support/users/invik/)
 * (@invik)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/positioning-bug-solution-1/)
 * Hi!
 * I have discovered your plugin today, as I was trying to inser ta small pop up
   on the bottom-left part of my site. After I got it, I realized that the pop up
   was sticking to the left side of my browser, despite the fact that I had set 
   some pixel space at the “Left / Distance from the left edge of the screen.” Item.
 * I had a look at your code, and found the bug at line 140 & following of file “
   popup-maker/includes/popup-functions.php”:
 *     ```
       if ( ! strpos( $display['location'], 'left' ) ) {
                       unset( $display['position_left'] );
               }
               if ( ! strpos( $display['location'], 'right' ) ) {
                       unset( $display['position_right'] );
               }
               if ( ! strpos( $display['location'], 'top' ) ) {
                       unset( $display['position_top'] );
               }
               if ( ! strpos( $display['location'], 'bottom' ) ) {
                       unset( $display['position_bottom'] );
               }
       ```
   
 * The problem was that, my “location” being “left bottom”, the conditions evaluated
   as “0” for the first “strpos”, “false” for the next two, and “5” for the last
   one. The problem is that the negation of both “0” and “false” resolve as “true”,
   triggering the “if” statements, and making my “left” space disappear.
 * A solution would be changing the code a little bit, to require a strict evalulation
   of “strpos” as “false” to trigger the “unset” functions.
 *     ```
       if ( strpos( $display['location'], 'left' ) === false ) {
                       unset( $display['position_left'] );
               }
               if ( strpos( $display['location'], 'right' ) === false) {
                       unset( $display['position_right'] );
               }
               if ( strpos( $display['location'], 'top' ) === false) {
                       unset( $display['position_top'] );
               }
               if ( strpos( $display['location'], 'bottom' ) === false) {
                       unset( $display['position_bottom'] );
               }
       ```
   
 * [https://wordpress.org/plugins/popup-maker/](https://wordpress.org/plugins/popup-maker/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/positioning-bug-solution-1/#post-6552989)
 * [@invik](https://wordpress.org/support/users/invik/) – Closing as this is a duplicate.

Viewing 1 replies (of 1 total)

The topic ‘Positioning bug solution’ is closed to new replies.

 * ![](https://ps.w.org/popup-maker/assets/icon-256x256.gif?rev=3097653)
 * [Popup Maker - Boost Sales, Conversions, Optins, Subscribers with the Ultimate WP Popup Builder](https://wordpress.org/plugins/popup-maker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/popup-maker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/popup-maker/)
 * [Active Topics](https://wordpress.org/support/plugin/popup-maker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/popup-maker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/popup-maker/reviews/)

## Tags

 * [positioning](https://wordpress.org/support/topic-tag/positioning/)

 * 1 reply
 * 2 participants
 * Last reply from: [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/positioning-bug-solution-1/#post-6552989)
 * Status: resolved