Title: [Hook] Making map Responsive
Last modified: August 31, 2016

---

# [Hook] Making map Responsive

 *  Resolved [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/hook-making-map-responsive/)
 * Hi,
    First, thanks for the plugin! I’m not really asking for support, but sharing
   a trick I use to **make the map responsive** for a website I’m building:
 * Add this to functions.php in a (child) theme or plugin:
 *     ```
       add_filter( 'bgmp_clean-map-shortcode-arguments-return', 'overide_BGMP_arguments', 100 );
   
       function overide_BGMP_arguments( $params ) {
   
       	if( $params['mapWidth'] == '100' ) {
       		$params['mapWidth'] = "100%";
       	}
       	return $params;
       }
       ```
   
 * Then when you insert a map, choose ‘100’ for the width.
    Voilà.
 * [https://wordpress.org/plugins/basic-google-maps-placemarks/](https://wordpress.org/plugins/basic-google-maps-placemarks/)

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

 *  [clemrov](https://wordpress.org/support/users/clemrov/)
 * (@clemrov)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/hook-making-map-responsive/#post-7455289)
 * Hi Marcusig,
 * Thanks for the recommendation!
 * I am new to WordPress and I am using the insert php plugin and this is what I
   inserted on my page for the map but it does not work:
    (it creates a second box
   below the map)
 * [bgmp-map]
    [insert_php] add_filter( ‘bgmp_clean-map-shortcode-arguments-return’,‘
   overide_BGMP_arguments’, 100 );
 * function overide_BGMP_arguments( $params ) {
 *  if( $params[‘mapWidth’] == ‘100’ ) {
    $params[‘mapWidth’] = “100%”; } return
   $params; } [/insert_php]
 * Do you have any advice to apply your trick in this context ?
 * Thanks,
 *  Thread Starter [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/hook-making-map-responsive/#post-7455291)
 * Hi clemrov,
 * Try inserting the [bgmp-map] shortcode **after** the [insert_php] one, as the
   php has to be executed first.
    And if it doesn’t work, you’ll probably have to
   put the php in your theme’s Functions.php file or in a plugin. (If you use a 
   third party theme, I strongly recommend making a child theme to make this sort
   of changes), or making a quick plugin — is you can). Also your [bgmp-map] must
   have 100 set for its width. So either in the plugin’s settings, eiher passed 
   as an argument: [bgmp-map width=”100″]
 *  [clemrov](https://wordpress.org/support/users/clemrov/)
 * (@clemrov)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/hook-making-map-responsive/#post-7455305)
 * I included it in the child theme and now it works 🙂
    Thanks a lot!

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

The topic ‘[Hook] Making map Responsive’ is closed to new replies.

 * ![](https://ps.w.org/basic-google-maps-placemarks/assets/icon-128x128.png?rev
   =1152531)
 * [Basic Google Maps Placemarks](https://wordpress.org/plugins/basic-google-maps-placemarks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/basic-google-maps-placemarks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/basic-google-maps-placemarks/)
 * [Active Topics](https://wordpress.org/support/plugin/basic-google-maps-placemarks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/basic-google-maps-placemarks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/basic-google-maps-placemarks/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [clemrov](https://wordpress.org/support/users/clemrov/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/hook-making-map-responsive/#post-7455305)
 * Status: resolved