WordPress.org

Forums

CP Google Maps
[resolved] Template shortcode not workink ... map code is empty (6 posts)

  1. masterbip
    Member
    Posted 1 year ago #

    Hi there. I think this google map plugin really rocks. But I got an issue. I'm using this in my custom index
    <?php echo do_shortcode('[codepeople-post-map]'); ?>

    When browsing got this html code as part of shortcode
    ---------
    <div id="cpm_Qjf9Qv" class="cpm-map" style="display:none; width:100%px; height:360px; clear:both; overflow:hidden; margin:10px auto;"></div>
    <script type="text/javascript">
    var cpm_language = {"lng":"es"};var cpm_global = cpm_global || {};
    cpm_global['cpm_Qjf9Qv'] = {};
    cpm_global['cpm_Qjf9Qv']['zoom'] = 10;
    cpm_global['cpm_Qjf9Qv']['dynamic_zoom'] = false;
    cpm_global['cpm_Qjf9Qv']['markers'] = new Array();
    cpm_global['cpm_Qjf9Qv']['display'] = 'map';
    cpm_global['cpm_Qjf9Qv']['highlight_class'] = 'cpm_highlight';
    cpm_global['cpm_Qjf9Qv']['highlight'] = true;
    cpm_global['cpm_Qjf9Qv']['type'] = 'ROADMAP';
    cpm_global['cpm_Qjf9Qv']['show_window'] = true;
    cpm_global['cpm_Qjf9Qv']['show_default'] = true;
    cpm_global['cpm_Qjf9Qv']['mousewheel'] = true;
    cpm_global['cpm_Qjf9Qv']['zoompancontrol'] = true;
    cpm_global['cpm_Qjf9Qv']['typecontrol'] = true;
    </script>
    ------------------
    But there is no map!!!

    What I'm doing wrong?
    Thanks, sorry to bother you, but this is kind of urgent....

    http://wordpress.org/plugins/codepeople-post-map/

  2. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Please, be sure you have defined at least a point in the page or post.

  3. webmystery
    Member
    Posted 1 year ago #

    So it looks like I can't put his in a template file like archive.php, and that it has to be in a page or a post (in which case the regular shortcode is all you need).

    I tried putting the map in an individual post to show on the archive page, but then it ignores the individual post map settings and reverts to the default size. I need it 200px here: http://vallejoopenstudios.com/category/artists/2013/

    I only want one map here - not one for every post. Thanks!

    (what I really want is a percentage width, but that appears to break it - I'll write that up as a separate issue)

    Update - now it is displaying a map with no background for the most recent post I added a map to, so I set .archive .cpm-map to display:none

  4. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    You may insert the shortcode of map directly in the archive template, but the points must be associated to the posts to be loaded in the archive. If the posts displayed in the archive page have not points associated the map is not displayed.

    The shortcode to insert in templates is:

    <?php echo do_shortcode('[codepeople-post-map]'); ?>

  5. sebasll
    Member
    Posted 1 year ago #

    Hi any change you could help me out,

    I'm trying to use the plugin but cannot get it to work whatsoever.

    I've tried putting <?php echo do_shortcode('[codepeople-post-map]'); ?> in my template however I get an empty div:

    <div id="cpm_JLDt5X" class="cpm-map" style="display:none; width:450px; height:500px; clear:both; overflow:hidden; margin:10px auto;"></div>

    I've also tried "Insert Map Tag" after verifying the address, but this yields nothing. Not even an empty div. So something is definitely not loading or working properly.

    Actually, I tried loading jQuery in the header as it was loading at the bottom...and that seems to have fixed it. However, we would prefer to keep jQuery at the bottom.

    Any chance of getting this to work with jQuery at the bottom of the page?

    Thanks!!

  6. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    If you insert the shortcode directly on template file, the map will be displayed if any of posts loaded on page includes a point.

    If the issue persist, I will need the WordPress access to check the issue in detail (uses our support page, http://wordpress.dwbooster.com/support), and please, indicate the template file where the shortcode was inserted.

    Best regards.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • CP Google Maps
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.