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/
WordPress has emerged as not only a leading blogging platform but also a content management…
Properly configured, Wordpress can be an extremely effective way of designing, maintaining and managing your…
WordPress 2.7 Beta 3 has been released for your testing pleasure. Here are some of…
This little trick is really simple and easy. All you need to do is plug…
This powerful plugin is a must-have for WordPress users. With WP-DBManager you can manage your…
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.