Title: Replacing Map on page load with image, disappears on search
Last modified: August 22, 2016

---

# Replacing Map on page load with image, disappears on search

 *  Resolved [mkvrk](https://wordpress.org/support/users/mkvrk/)
 * (@mkvrk)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/map-a/)
 * Great plug-in, Just inquiring if this is possible and if so, how would one go
   about implementing it.
 *  Upon page load , instead of map, it will be an image that will prompt user to
   insert their credentials above in the search bar area but I still want the locations
   to stay on the left side.
 * Basically an image would replace the map but after clicking submit, after putting
   your postal code, the image would disappear, and the map would function as intended
   with the closest locations showing up.
 * I know jQuery shall be involved and I referenced this as a starting point [https://wordpress.org/support/topic/how-to-add-a-search-inputbutton-to-my-home-page?replies=8](https://wordpress.org/support/topic/how-to-add-a-search-inputbutton-to-my-home-page?replies=8).
 *  I just need assistance in the recommended way about going about it and if you
   have any code that will push me in the right direction, I would appreciate it.
 * [https://wordpress.org/plugins/wp-store-locator/](https://wordpress.org/plugins/wp-store-locator/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/map-a/#post-5524831)
 * You need to open the correct template in the /front-end/templates folder, then
   look for ‘$output .= ‘<div id=”wpsl-gmap”></div>’ . “\r\n”;’
 * Then wrap a [is_user_logged_in](http://codex.wordpress.org/Function_Reference/is_user_logged_in)
   around it. So you get something like this.
 *     ```
       if ( is_user_logged_in() ) {
          $output .= '<div id="wpsl-gmap"></div>' . "\r\n";
       } else {
          //the html for the image or whatever you want.
       }
       ```
   
 * Or if you want to place the image on top of the map you would get something like
   this.
 *     ```
       if ( !is_user_logged_in() ) {
          //the html for the image or whatever you want.
       }
   
       $output .= '<div id="wpsl-gmap"></div>' . "\r\n";
       ```
   
 * And then use css and position:absolute to place the image on top of the map.
 * If you want to force the store locator to search after the user loggedin, and
   trigger the submit button so that some locations show up. Then you should look
   at jquery [trigger](http://api.jquery.com/trigger/).
 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/map-a/#post-5524832)
 * > prompt user to insert their credentials above in the search bar area
 * I assumed this was the wp login field? Or is this something completely different?
 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/map-a/#post-5524837)
 * Also, if you open the /js/wpsl-gmap.js and search for the first line in then 
   code below, then you have the code that handles the submit button.
 * If you want to replace the image you have then you can add your code in that 
   section. Just remove the yourimage, with the ID you assigned to the image
 *     ```
       $( "#wpsl-search-btn" ).on( "click", function() {
       //lots of other code.
          $( "#yourimage" ).remove();
       }
       ```
   
 *  Thread Starter [mkvrk](https://wordpress.org/support/users/mkvrk/)
 * (@mkvrk)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/map-a/#post-5524869)
 * This issue has been resolve for now – Thank you very much for your help.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Replacing Map on page load with image, disappears on search’ is closed
to new replies.

 * ![](https://ps.w.org/wp-store-locator/assets/icon-256x256.jpg?rev=1007784)
 * [WP Store Locator](https://wordpress.org/plugins/wp-store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-store-locator/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [mkvrk](https://wordpress.org/support/users/mkvrk/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/map-a/#post-5524869)
 * Status: resolved