WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know how to display the latest Foursquare checkin for a specific account on a WordPress blog?

Ideally I would like to add the function to the theme rather than use a plugin but i'm open to suggestions.

Thanks in advance, G

share|improve this question
up vote 2 down vote accepted

Here is a solution for you:

First download this nice little class

Next, include it and “login”

require_once 'foursquare.php'; //Load the foursquare class
$foursquare = new fourSquare("username", "password"); //login

Then to get the venue’s name use:

<?php echo $foursquare->venueName; ?>

you can also get the venue's type,venue's icon, venue's location on the map and user’s comment on the venue. its all documented at the link provided above.


Since FourSquare changed their API i found a much simpler solution: login to your foursquare account and then head to http://feeds.foursquare.com/ and copy the rss feed url. and use this:

// $numCheckins - number of checkins to get
function Display_last_checkins($numCheckins = 2){
    $feedURL = 'enter your rss feed here';
    $feedObject = simplexml_load_file($feedURL . '?count=' .$numCheckins);
    $items = $feedObject->channel;
    $checkin = $items->item;
    echo '<ul>';
    $count = 0;
    foreach ($checkin as $item) {
        if ($item->link != '') {
            echo '<li><a href="'. $item->link .'">' .
                $item->title . '</a><br/></li>';
            /* you can use 
            $item->description  - user comment
            $item->pubDate      - publish date and time (Wed, 27 Apr 11 16:40:18 +0000)
            $item->georss:point - location for map (31.613221 34.76874)

            if ($count == $numCheckins) {break;}
    $echo .= '</ul>';
share|improve this answer
Some caching will do good :) – Ashfame Aug 9 '11 at 13:58
Hi Bainternet, I've included the above and it's authorising (I deliberately broke it and got the password error) however the actual echo isn't working? Any ideas? – George Wiscombe Aug 9 '11 at 14:53
create a pastebin of the exact code you are using – Bainternet Aug 9 '11 at 15:36
Yep found it, FourSquare changed there API at 1st of august, so its a bit out dated , ill take a look at there API and what i can come up with. – Bainternet Aug 9 '11 at 15:57
Brilliant thanks! – George Wiscombe Aug 9 '11 at 16:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.