Today I was working on the WordCamp.LA site. I was trying to show the “attendee list” on the attendees page with out having to update the page every day.
Since I am using EventBrite to promote and sell ticket to the event I can collect info from there list. Evey one who purchases a ticket gets put into the ticketed database which you can view with either RSS or OPML.
I chose to use RSS and the WordPress core file rss.php
.
In the functions.php file I’ve added this function:
function attendee_feed_print_2009() { global $wpdb; include_once( ABSPATH . WPINC . '/rss.php' ); $rss = fetch_rss( 'http://www.eventbrite.com/rss/event_list_attendees/384870157' ); $items = array_slice( $rss->items, 0 );
Where I’ve named my function, and included the core RSS file from WordPress. I also told it to fetch the feed from the address (alternatively you can use any feed link you like).
if ( empty( $items ) ) echo '<ul style="list-style-type: none; list-style-image: none; list-style-position: outside;"><li>No items</li></ul>'; else foreach ( $items as $item ) : ?> <ul style="list-style-type:none; list-style-image:none; list-style-position:outside; margin-bottom: 0px"> <li><!--<strong><?php echo $item[ 'title' ]; //User name ?></strong><br />--> <?php echo $item[ 'content' ][ 'encoded' ]; ?> <hr style="border: 1px solid #ddd; margin-bottom: 8px" /> </li> </ul> <?php endforeach;
I then added the core style to fit this current feed.
And the final out come looks like this:
function attendee_feed_print_2009() { global $wpdb; include_once( ABSPATH . WPINC . '/rss.php' ); $rss = fetch_rss( 'http://www.eventbrite.com/rss/event_list_attendees/384870157' ); $items = array_slice( $rss->items, 0 ); if ( empty( $items ) ) echo '<ul style="list-style-type: none; list-style-image: none; list-style-position: outside;"><li>No items</li></ul>'; else foreach ( $items as $item ) : ?> <ul style="list-style-type:none; list-style-image:none; list-style-position:outside; margin-bottom: 0px"> <li><!--<strong><?php echo $item[ 'title' ]; //User name ?></strong><br />--> <?php echo $item[ 'content' ][ 'encoded' ]; ?> <hr style="border: 1px solid #ddd; margin-bottom: 8px" /> </li> </ul> <?php endforeach; }
Don’t forget to wrap the code in <?php
?>
I want to thank John Kolbert for helping me with printing the content:encoded
portion. http://pastebin.com/m1588fb30
See it in action: http://wordcamp.la/attendees/
Classic CTR Themes For WordPress have made it pretty easy to build informational websites using…
In today's techno-centric culture, you simply must have a business website, no matter how small…
Photography is the art of capturing naturalistic images with the help of photographic cameras. It…
Have you opened up a new website or a business and want to drive more…
WordPress has evolved greatly from its origin as a powerful blogging platform to an effective…
Busіnеsѕеs аnd orgаnіzatіоns аll аrоund the wоrld arе loоking fоr а ѕоlutiоn thаt wоuld prоvе…
View Comments
Thanks for the tutorial. I'm going to try this out.
No problem, you may want to check out this plugin I created for this as well: Eventbrite Attendees Shortcode Plugin.