Mashups – Alternative To Using Thumbnails?

Home Forums MapPress Support Mashups – Alternative To Using Thumbnails?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12607
    CliveB
    Participant

      Chris,

      For technical reasons, I’m using custom fields to store my post thumbnails in one of my bespoke WP themes.

      I’ve tried tweaking the map_poi.php file to get the custom image field displayed using this code:

      <?php $postimagethumb = get_post_meta($post->ID, 'normalthumb', true); if ($postimagethumb) { ?>
      <img src="<?php bloginfo('url'); ?>/images/<?php echo $postimagethumb; ?>" class="mapp-thumb" width="45" height="45" />
      <?php } else { ?>
      <img src="<?php bloginfo('url'); ?>/images/single-item-image.jpg" class="mapp-thumb" width="45" height="45" />
      <?php } ?>

      But it doesn’t seem to pull the custom image and instead always displays the default image.

      Can you suggest a code snippet that will work, or is it something that can’t be done in map_poi.php?

      Cheers,

      Clive

      #12610
      Chris
      Keymaster

        Hi,

        Are you trying to display this template for mashups or for single posts?

        If it’s for mashups, you will need to get the postid from the poi rather than relying on the global $post variable:

        postid) {
        $post = get_post($poi->postid);
        …your code here…
        }
        ?>

        You might also want to try just placing that code in your theme to verify that it’s working before trying to use it in the map poi…

        If that doesn’t help, please send me the template so I can take a look (you can just paste it into the contact form on the site).

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.