Jump to content
Sign in to follow this  
lmmolitor

Adding MapPress Map Shortcode to Banner Image

Recommended Posts

lmmolitor

I've used the MapPress plugin to set up a map for the home communities we are building and it was quite easy for a novice like myself :). However I'm now wanting to use the MapPress shortcode [mappress mapid=???1???] to use the map i've created (you can see it here http://www.greenbankdevelopment.com/communities/ ) as in the banner i use on my home page as the banner image. The problem is, when i go to edit the banner image i only see the options to upload media via "Banner Media" section or add HTML. Since I only have the short code [mappress mapid=???1???] I'm wondering if there is a way to put this in an HTML format?

Share this post


Link to post
Share on other sites
bryan-hadaway

You could of course try the shortcode in the HTML spot, you never know. But, you'll likely need to contact the support for the plugin and look into if they have a standalone code for the plugin, likely PHP or JS. Thanks, Bryan

Share this post


Link to post
Share on other sites
lmmolitor

thanks Bryan, i've reached out to them and post here whatever i learn for others to access.

Share this post


Link to post
Share on other sites
lmmolitor

I was able to get the following instructions from MapPress on using PHP to display MapPress maps anywhere on Wordpress:

Maps can be displayed anywhere on your blog ??“ in the header, footer, sidebar, etc. MapPress loads all of the required Javascript and CSS only when a map is being displayed. To add a map to your template you must enter a few lines of PHP code:
<?php global $mappress; echo $mappress->shortcode_map(array($atts)); ?>
The $atts argument can contain any of the attributes you can specify for the map shortcode, as described above. For example, this displays the map with ID = 20:
<?php global $mappress; echo $mappress->shortcode_map(array("mapid" => 20)); ?> I entered this information (with mapid for map I created here http://www.greenbankdevelopment.com/communities/ ) into HTML section for banner image on my home page www.greenbankdevelopment.com. However it isn't working and is only showing
shortcode_map(arry("mapid"=>1)):?>
where banner image is supposed to be. Any insight into what I am doing wrong?

Share this post


Link to post
Share on other sites
lmmolitor

MapPress just got back to me with following instructions ...

If you want a 'live' map that can be clicked - you have the right PHP code <?php global $mappress; echo $mappress->shortcode_map(array("mapid" => 20)); ?> but you'll need to add it directly to one of the theme's .php files. As you noticed, the theme is treating it as plain text, rather than interpreting it as PHP code.
How do I add it to the Platform Pro .php file?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×