waynedunkley
9/16/2014 - 8:06 AM

Facebook Share Button

Facebook Share Button

function facebook_share($id){

	$url = urlencode($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
	$fbid = urlencode( '691847187557613' );
	$redirect_uri = urlencode($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
	$title = urlencode( get_the_title( $id ) );
	$summary = urlencode( 'Coogee Bay Hotel' );
	$description = urlencode( get_field( 'description', $id ) );
	$image = urlencode( get_field( 'image', $id ) );
	$link = urlencode($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
	?>
	<div class="share-cont">
		<div class="share">
			<span>SHARE</span>
			<a  class="facebook" onClick="window.open('https://www.facebook.com/dialog/feed?app_id=<?php echo $fbid;?>&picture=<?php echo $image;?>source=<?php echo $image;?>&name=<?php echo $title;?>&display=popup&caption=<?php echo $summary;?>&description=<?php echo $description;?>&link=<?php echo $redirect_uri;?>&link=<?php echo $redirect_uri;?>&redirect_uri=<?php echo $redirect_uri;?>','sharer','toolbar=0,status=0,width=648,height=325');" href="javascript: void(0)"><i class="fa fa-facebook"></i></a>
		</div>
		<div class="clearfix"></div>
	</div>

	<?php
}