cyberhobo / wordpress-geo-mashup

Official repository for Geo Mashup, the plugin that makes WordPress into a GeoCMS. Documentation:
https://github.com/cyberhobo/wordpress-geo-mashup/wiki/Getting-Started
63 stars 15 forks source link

please use 150x150 (or thumbnail generated size) for leaflet popup post attachment #832

Closed Photogad closed 4 years ago

Photogad commented 5 years ago

I want it to display the featured photo from my post in the map pin popup, so I enable post attachment setting. But it's pulling the FULL SIZE 4000px wide image from my server and putting it in the leaflet popup. For example, see my map and click on a pin: https://earththroughthelens.com/map/

This is causing massive page slowdown and also the user can't see the huge photo in the tiny box.

I tried limited it with CSS but that didn't help.

Let me know how much to pay you to fix this and issue an update to the plugin on wordpress

aerdemsenturk commented 5 years ago

You need to edit the info window template. Here is more information: https://github.com/cyberhobo/wordpress-geo-mashup/wiki/Feature-Usage#templating

and for resizing the featured image you can use this code: <?php the_post_thumbnail( array(150,150) ); ?>

smadds commented 5 years ago

I agree this needs changing - the code currently assumes the default image size is thumbnail. If you create a geo-mashup-info-window.php file in your theme's root folder you can overwrite the div class='info-thumb' line with:

<div class="info-thumb"><?php the_post_thumbnail('thumbnail'); ?></div>

(I also used it to remove the date & category info, that I didn't need)

Photogad commented 5 years ago

<?php the_post_thumbnail( array(150,150) ); ?>

thanks that worked

Photogad commented 5 years ago

You need to edit the info window template. Here is more information: https://github.com/cyberhobo/wordpress-geo-mashup/wiki/Feature-Usage#templating

and for resizing the featured image you can use this code: <?php the_post_thumbnail( array(150,150) ); ?>

thanks that worked.

Photogad commented 5 years ago

Is there also a way to edit the php file to make the thumbnail clickable and it takes them to that post?

aerdemsenturk commented 4 years ago

Is there also a way to edit the php file to make the thumbnail clickable and it takes them to that post?

You can use it for clickable thumbnail : <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( array('thumbnail') ); ?></a>