strangerstudios / pmpro-membership-maps

Works with Paid Memberships Pro and the Member Directory Add On to add maps to the directory and profiles.
https://www.paidmembershipspro.com/add-ons/membership-maps/
2 stars 8 forks source link

Setting the layout of the directory to "column" causes the maps not to render appropriately #27

Closed MaryOJob closed 2 years ago

MaryOJob commented 3 years ago

Describe the bug Setting the layout attribute in the directory shortcode to any column, 1 or 2 or 4, shows the map in the first column (making it tiny if 2 or 4), and then lists members in the next three columns

To Reproduce Steps to reproduce the behavior:

  1. Activate the Membership Directory Add On
  2. Use this shortcode '[pmpro_member_directory layout="3col"]'
  3. Visit the directory page
  4. See issue

Screenshots

Screen Shot 2021-01-18 at 11 47 19 PM

WordPress Environment PMPro 2.5.2 PMPro Member Directory Add On 1.1 WP 5.6 PHP 7.4

bluesteamhost commented 3 years ago

I had this exact issue as well so I used the following code recipe to unhook the map from the directory and profile pages and then manually added the shortcode for the map to the relevant pages. Unhooking the map is explained on the addon page here: https://www.paidmembershipspro.com/add-ons/membership-maps/#shortcode

function mypmpromm_remove_map_membership_directory(){

    //Removes the map from the directory page
    remove_action( 'pmpro_member_directory_before', 'pmpromm_load_map_directory_page', 10, 2 );

    //Removes the map frm the single profile page
    remove_action( 'pmpro_member_profile_before', 'pmpromm_show_single_map_profile', 10, 1 );

}
add_action( 'init', 'mypmpromm_remove_map_membership_directory' );
MaryOJob commented 3 years ago

I had this exact issue as well so I used the following code recipe to unhook the map from the directory and profile pages and then manually added the shortcode for the map to the relevant pages. Unhooking the map is explained on the addon page here: https://www.paidmembershipspro.com/add-ons/membership-maps/#shortcode

function mypmpromm_remove_map_membership_directory(){

  //Removes the map from the directory page
  remove_action( 'pmpro_member_directory_before', 'pmpromm_load_map_directory_page', 10, 2 );

  //Removes the map frm the single profile page
  remove_action( 'pmpro_member_profile_before', 'pmpromm_show_single_map_profile', 10, 1 );

}
add_action( 'init', 'mypmpromm_remove_map_membership_directory' );

Thank you for noting and sharing this.

bluesteamhost commented 3 years ago

You're welcome. I do agree that the rendering of the map layout is borked in it's current fashion and needs to be fixed. The solution posted above is only a workaround for now as it is not meant to render in that fashion.

MaryOJob commented 3 years ago

You're welcome. I do agree that the rendering of the map layout is borked in it's current fashion and needs to be fixed. The solution posted above is only a workaround for now as it is not meant to render in that fashion.

👍