Connect with us

Tips & Tricks

Use WordPress to print a RSS feed for Eventbrite attendees

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/

4 Comments

4 Comments

  1. Pingback: Twitted by eventbrite

  2. Pingback: Turn your RSS feed into a shortcode — WPCult

You must be logged in to post a comment Login

Random Search Terms

Title

Top Articles

powered by WassUp

Recent Posts: Fully Net Worth . com

Alejandro Rosario Net Worth: How Rich is the Tik Tok star?

Alejandro Rosario Net Worth: How Rich is the Tik Tok star?

Alejandro Rosario is an up and coming Internet superstar who is famous for his activities on an app called Tik Tok. Within a couple of months, Rosario has been able to gain a huge following on his Tik Tok account. As of 2019, Alejandro Rosario net worth is estimated to be $100,000. Alejandro was born […]

Cyril Hanouna Net Worth: How Rich is the French TV Star?

Cyril Hanouna Net Worth: How Rich is the French TV Star?

Cyril Valéry Hanouna is a French radio and television presenter, writer, and producer. Hanouna is a polarizing figure who is best known for being the host of the popular French TV show Touche Pas à Mon Poste! As of 2019, Cyril Hanouna net worth is estimated to be $5 million. Hanouna was born on 23 […]

Donna Marie Lombardi Net Worth- How Rich is Black Ink Crew Star?

Donna Marie Lombardi Net Worth- How Rich is Black Ink Crew Star?

Taylor Monet Pinkney, who is better known as, Donna Marie Lombardi, is a tattoo artist and an influencer. She is best known for playing an important role in the reality television series called Black Ink Crew which airs in VH1. As of 2019, Donna Marie Lombardi net worth is estimated to be $350,000. Donna was […]