Runkeeper WordPress Plugin

Posted by on Apr 6, 2010 in Code Chat, WordPress | 35 Comments
Runkeeper WordPress Plugin

The Runkeeper plugin for WordPress lets you embed a preview of your activities in to posts using a custom field or shortcode.

Take a look at an Example of the plugin in action.

Version 2.0

The new version offers two options for adding maps in to posts:

  • Create a custom field called “runkeeper” and paste in the “Share” link from your activity on Runkeeper
  • Use the shortcode [[[runkeeper url=”example”]]] at any point in your post where you would like the map to appear, replacing “example” with the “Share” link from Runkeeper.

The new version also allows you to change the width, height and offset of the preview using the Settings page. Go to Settings > Runkeeper in the admin menu. The default values are: Width: 600px, Height: 400px, X: 300px, Y: 300px

Find Out More and Download

Custom Fields in Posts

If you’ve not used custom fields in your posts before, it’s really simple.

When you add a new post, look down the page to the section called “Custom Fields”. Click “Enter New”, then add the “Name” “runkeeper” and the value is the address of the activity you want to embed. If you don’t have the Custom Fields section on the page, you may need to select it from the Screen Options menu in the top right.

Take a look at the example below.

Shortcodes

Shortcodes are tags enclosed in square brackets which can be entered anywhere in the post. When the post is displayed on the front end, the shortcode will be replaced with dynamic content, in this case a Runkeeper map.

An example shortcode for the Runkeeper plugin is:

[[[runkeeper url=”http://runkeeper.com/user/peterasmith/activity/25780715″]]]

 

Donate

If you like this plugin, why not donate to help keep this project going.

35 Comments

  1. kandasa
    August 26, 2012

    Last update made all my pages that worked fine before, to be empty where runkeeper should be. I even tried the new tagg [runkeeper url=”…”] with same result.

    Reply
    • Peter
      August 31, 2012

      Hello, sorry to hear that the plugin isn’t working for you. I’ve made a couple of updates, can you try updating the plugin to version 2.2 and let me know if that solves the problem? If not, can you send me a link to an example page on your site where the runkeeper plugin is used?

      Thanks

      Peter

      Reply
  2. Peter Sejersen
    August 21, 2012

    Thanks for the plugin. I’m also looking for a way to re-size the frame. I have tried, but the content in the frame gets cut off in the right side, see http://www.youareborntorun.com/ai1ec_event/137/?instance_id=9

    Reply
    • Peter
      August 22, 2012

      Hi, I’ve recently updated the plugin. The new version supports customising the iFrame size and offset. Please try updating and let me know if you have any more problems.
      Thanks for the interest.
      Peter

      Reply
      • Peter Sejersen
        August 30, 2012

        Hi Peter,

        Thanks for the effort and fast reply. I have just updated the plugin and inserted the new shortcode in a post: http://www.youareborntorun.com/ai1ec_event/riis-skoven-revisited/?instance_id=21

        But it doesn’t work.

        Any ideas for how to fix?

        Reply
        • Peter
          August 31, 2012

          I think I’ve spotted the problem. Looks like the plugin was relying on the jQuery library which your site wasn’t using. I’ve updated the plugin to version 2.2 which doesn’t require jQuery. Hopefully, if you update again, that might solve the problem. Thanks for letting me know.

          Peter

          Reply
          • Peter Sejersen
            September 4, 2012

            Cool. That fixed the problem, but the iframe i still cut off for some reason. Any suggestions? http://www.youareborntorun.com/ai1ec_event/riis-skoven-revisited/?instance_id=21

            Btw: Thanks so much for helping 🙂

          • Peter
            September 4, 2012

            Hi, I’ve taken a look at your example post and I think I’ve spotted the problem.
            There is a style attribute in your theme’s stylesheet that is setting
            embed, iframe, object{ max-width:100%; }
            If you either remove that style, or add another style to override it:
            #runkeeper iframe{ max-width:inherit; }
            That should do the trick.

            Let me know if you manage to sort it out.

            Thanks

            Peter

          • Peter Sejersen
            September 4, 2012

            It worked, thanks!

  3. Anders
    July 3, 2012

    This is awesome!
    However…
    I have created a custom field called “runkeeper” and inserted the “share”-link from runkeeper.com.
    But my page renders the iframe a bit strange, have a look:
    http://bloggen.hyden.nu/2012/07/03/skon-kvallspromenad/

    Any idea?

    Reply
  4. Anders
    May 16, 2012

    Great plugin, but is it possible to change the size of the frame? Now I have to slide left and right to see all the information.

    Reply
    • Peter
      August 22, 2012

      Hi, I’ve recently updated the plugin. The new version supports customising the iFrame size and offset. Please try updating and let me know if you have any more problems.
      Thanks for the interest.

      Peter

      Reply
  5. Michael
    February 17, 2012

    Just a small note… may want to update lines 43 and 44 to use

    [code] href="'.WP_CONTENT_URL.'/plugins[/code]

    instead of

    [code]href="'.get_bloginfo('wpurl').'/wp-content/plugins[/code]

    as it doesn’t work if you’ve renamed the wp-content folder. There are a few security plugins that will rename that folder. By changing the code, the plugin will still work for those people. Thanks!

    Reply
    • Peter
      August 22, 2012

      Thanks for the tip,
      I’ve included that in the new version. Please check it out and let me know if you have any problems.

      Reply
  6. jake
    February 1, 2012

    Any way to configure the size of the iFrame? Mine is extending into my sidebar by about 50 pixels or so.

    Reply
    • Peter
      August 22, 2012

      Hi, I’ve recently updated the plugin. The new version supports customising the iFrame size and offset. Please try updating and let me know if you have any more problems.
      Thanks for the interest.

      Reply
  7. Mario
    September 20, 2011

    Hi Peter,

    Thanks for the plugin, it does work for me. However with two serious limitations:

    1. It produces a box underneath ALL posts, even those without a custom ‘runkeeper’ field. A big empty box obviously disturbs the blog design.

    2. It does not allow to put more than one map in one post, right? Something like that would be really helpful… And maybe a few options to adjust the size of the preview box manually.

    Thanks for your help!
    Mario

    Reply
  8. Jacob
    August 12, 2011

    Hey, thanks for a lovely plugin, although there is one thing that concerns me.

    On my summary page (where I list all my posts one after another), the runkeeper iframe is added to ALL posts that are published earlier than (or below) the post with the actual data, although they have no data of course since I have no value in my custom field.

    In other words, I need something that kills the runkeeper session or really checks if there is a value in a particular post to prevent it from not displaying data for every post.

    Is this possible?

    best regards / Jacob

    Reply
  9. G
    July 1, 2011

    Thanks so much for your work on this plug-in. In the future, might there be a configuration option to select a size for the frame, or is this limited by the data returned from RunKeeper.com? Example post: http://www.nafzinger.com/2011/07/01/thursday-brookside-ride-in-kansas-city/

    Reply
  10. Josh Feldberg
    June 24, 2011

    This is brilliant. It really does work. I’d love to be able to add photos to the map but I don’t think this is possible

    Reply
  11. Per Soderlund
    May 24, 2011

    New problem: If I have two runkeeper activities on the same page, only the topmost is showing. If I look at single posts the other activity shows up. Trying to find the problem, help appreciated!

    Reply
  12. Per Soderlund
    May 23, 2011

    Okay. Sorry. Noticed in the header that the plugin directory is supposed to be “runkeeper-plugin”, I had named it simply “runkeeper”. Working now. So never mind my previous posts.
    Thanks for the plugin though.

    Reply
  13. Per Soderlund
    May 23, 2011

    Hmmm…seems like my pasted code was censored? You can find it live at: http://moonwork.se/maratonmannen

    Reply
  14. Per Soderlund
    May 23, 2011

    Hi!
    This plugin is exactly what I was looking for, just too bad I can’t make it work.
    Adding the custom field “runkeeper” just adds this to the post:

    An empty “runkeeper” div with correct title… Nothing visible on the post.

    And in the head section:

    Any Ideas?
    By the way, new to WP so please explain as for an ignorant idiot, maybe I understand 🙂

    Running WP ver. 3.1.2, downloaded rukeeper plugin from

    Reply
  15. Jon
    March 5, 2011

    Hi Peter

    Cool plug-in. Thanks. I managed to enter a custom field in my post and it displays the runkeeper shared URL fine. However, it seems have confused some other custom fields that I have for tweet this. On my home page now, all posts are attempting to show the runkeeper url I entered on one post. any idea how I rectify this.

    Many Thanks

    Jon

    Reply
  16. Michael
    February 21, 2011

    ack, spell checkers!

    That’s supposed to be jQuery version 1.4.2

    [code]

    [/code]

    Reply
    • Peter
      February 21, 2011

      Hi Michael,

      You’re quite right, I managed to break the plugin in the new release. Looks like the path to the JS and CSS files has changed.

      I’m going to release another revision which should fix it.

      Sorry about that, let me know if you get it working after the next update.

      Best of luck with the 40 LBS from a chilly Leeds!

      Peter

      Reply
      • Peter
        February 21, 2011

        By the way, the new version no longer requires jQuery, that should make it more compatible for other users too.

        Reply
  17. Michael
    February 21, 2011

    Greetings Peter.

    First off, thanks for the contribution to both the Runkeeper and WordPress community.

    I’m not sure if it is from today’s update to 1.10, but although I have the plugin activated, custom field created, and appropriate link defined, I’ve received failure of the plug-in to publish the preview here on http://to185.com/runkeeper-is-my/

    The plugin appears to be attempting its job, in that it loads the stylesheet for the plugin

    jQuery is indeed being called (a .4.2)

    and the div id runkeeper is as well being loaded in the post.

    I did however find a comment following that indicating, or perhaps hinting at the fact that PHP 5 is involved.

    The server has as php5 as its default versrion.

    After overriding that and forcing php4 to load, I have errors loading the site at all, so perhaps the error is something PHP related?

    Hope this rundown helps you, as I’d really like to see this in play on my site. 🙂

    Thanks again for your efforts.

    Warm regards from chilly southwest Ohio,

    Michael

    Reply
  18. Jan
    February 13, 2011

    Here’s a post where Runkeeper preview should appear, but doesn’t
    http://www.laufsachen.net/2011/02/runkeeper-preview-unter-diesem-post/

    I think the problem might be “jQuery”. To be honest: I don’t have a clue if I have included this in my WP blog and if not how I should do this…

    Sorry to bother you with these newcomer issues…

    Reply
    • Peter
      February 15, 2011

      Yes, that sounds like you might be right. The plugin does need jQuery to be installed to function.
      I believe there are WordPress plugins which will include jQuery on your site for you. Otherwise you can download the jQuery javaScript file and include it the the header template.
      I’m planning on doing an update at some point which will allow it to function without jQuery but I haven’t gotten around to it yet. Let me know how you go.

      Reply
  19. Jan
    January 29, 2011

    Did all you said – doesn’t work. 🙁

    Reply
    • Peter
      February 12, 2011

      I’m sorry it’s not working for you. I’ve not had any other reports of problems with this. Can you send me an example of a post which you have attached a runkeeper field to so that I can see what markup, if any is being generated? Which other plugins are you using?

      Reply
  20. Jan
    January 17, 2011

    Hi,

    I have worked with custom fields before. Do you have a short guideline how to use runkeeper plug-in? Do I first have to modify my template and if so how / where?

    Thanks
    Jan

    Reply
    • Peter
      January 23, 2011

      You actually don’t need to modify your template at all. The plugin will insert the code to display the Runkeeper overview into the post. Just create a new custom field called “runkeeper” and paste the share code into it. The plugin will insert the Runkeeper overview following the body of the post.

      Reply

Leave a Reply