waynedunkley
9/22/2014 - 1:39 AM

Facebook share URL

Facebook share URL

//Follow will close the popup window after the Facebook redirect following share
if (window.location.hash.indexOf('#close_window') > -1 ){
	window.close()
}
$url = urlencode($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); //URL to share
$fbid = urlencode( '691847187557613' ); //App ID
$redirect_uri = urlencode("http://$_SERVER[HTTP_HOST]/#close_window");

$title = urlencode( get_the_title( $id ) ); //Share title
$summary = urlencode( 'Coogee Bay Hotel' ); //Share caption - sub heading
$description = strip_tags( get_field( 'description', $id ) );
$description = urlencode( $description ); //Description text

$image = urlencode( [image_url] ); //Share image

<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;?>&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>