Pay With A Tweet

Get 10% off No Thanks

WordPress Facebook Events Importer doesn’t require any coding to be done. The free version however will import Facebook events but take some work to get those posts on the frontend. Don’t worry we have plenty of code examples to get you started after you import your Facebook events.

The WordPress Facebook Events Importer base plugin wad originally created for developers looking for a fast solution to work with Facebook’s SDK. It includes all the required requests needed to import Facebook events and preset functions to quickly call up Facebook event property/fields.

Event /{event-id}

'id, cover,description,end_time,name,owner,place,start_time,ticket_uri,timezone'

You can develop your own WordPress page and single page templates using the code below. We have built in some functions to make it easier to generate variables and access the event data from Facebook.

First you will want to create a template to house all of your imported Facebook events. You can use the basic query below to get started.

You may want to create a separate page for your single event page instead of the default single.php page. You can generate one by creating a new file using 'facebook_events' the custom post type in as the template file name. For help Read about post type templates.


Display a Facebook event field

	<?php fbe_field('location'); ?>

Get as Facebook event field variable


	<?php $var = get_fbe_field('location'); 
	/* do something with $var later */ 
	?>

Working with Facebook event images

Parameters

'image_size'

Options

'cover', 'list', 'ad'
	<img src="<?php fbe_image('cover'); ?>" alt="" />

Query Facebook event posts

Parameters

'meta_value'

Event Options

'ticket_uri', 'location', 'fb_event_uri', 'image_url','geo_latitude','geo_longitude'

Venue Options

'venue_desc','facebook','venue_website','venue_email','venue_phone','event_timezone'

	<?php 
	 
		$args = array (
		    'post_type' => 'facebook_events',
			'posts_per_page' => -1,
			'order' => 'ASC',
		);
		
		$fbe_query = new WP_Query( $args );
		if( $fbe_query->have_posts() ): 
		while ( $fbe_query->have_posts() ) : $fbe_query->the_post();

		  $event_title = get_the_title();
		  $event_desc =  get_the_content();
		  $event_image = get_fbe_image('cover');
	
	?>
	  <img src="<?php echo get_fbe_image('cover'); ?>" alt="" />
	  <h1><?php echo $event_title; ?></h1>
	  <p><?php echo $event_desc; ?></p>    
	<?php

	     endwhile;
		 endif;
			
	wp_reset_query();  

	?>

Get Facebook event dates

Parameters

'meta_value','date_format'

Options

'event_ends', 'event_starts'

	 <?php

		 $event_starts = get_fbe_date('event_starts','M j, Y @ g:i a');
		 $event_ends = get_fbe_date('event_ends','M j, Y @ g:i a');

	 ?>

Date Formats: View PHP: date - Manual