Skip to content

ThirteeNov

My personal blog about coding and internet

Menu
  • About me
  • About Zofia Kreasi
  • Cart
  • Checkout
  • Making an airplane game from scratch in Unity
  • My account
  • Privacy Policy
  • Privacy Policy – zkLeaderboard
  • Sample Page
  • Shop
  • Tutorials on Learning JavaScript
  • ZKAccounts – Privacy Policy
Menu

How to use Facebook Comments plugin dynamically in your PHP websites

Posted on November 23, 2019August 4, 2020 by Habibie

This tutorial in this video showing you how to use Facebook Comments Plugin dynamically on each page of your website without adjusting it one by one on each page with the help of PHP.

Here is the code:

<!DOCTYPE html>
<html>
	<head>
		<title>Dynamic Facebook Comments Plugin Tutorial</title>
	</head>
	<body>
	
		<?php
		
			$weblink = "http://localhost/phptutorials/facebookcommentsplugin/";
		
			if(isset($_GET["about"])){
				
				$weblink = $weblink . "?about";
				
				?>
				
				<h1>About</h1>
				<p>This is About page</p>
				
				<?php
			}else if (isset($_GET["contactus"])){
				
				$weblink = $weblink . "?contactus";
				
				?>
				<h1>Contact us</h1>
				<p>Your contents here</p>
				<?php
			}else{
				
				?>
				
				<h1>Dynamic Facebook Comments Plugin Tutorial</h1>
				<p>Your contents here</p>
				
				
				
				<?php
				
			}
		
		?>
		
		<div id="fb-root"></div>
		<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v5.0&appId=569420283509636&autoLogAppEvents=1"></script>
		
		<div class="fb-comments" data-href="<?php echo $weblink ?>" data-width="" data-numposts="5"></div>
		
	</body>
</html>
Post Views: 356
ciihuy2020

Welcome!

  • My YouTube Channel
  • My GitHub Page
  • About me

Categories

  • 3DVista
  • Android
  • Apache
  • C#
  • Cordova
  • Electron & Node JS
  • HTML5, CSS & JavaScript
  • iOS
  • Let's Make Unity Games
  • Misc
  • Photoshop
  • PHP
  • Python
  • Uncategorized
  • Unity
  • WordPress

Recent Posts

  • Hover Reveal script for Unity to show and hide object on mouse hover
  • How to Prevent UI Clicks in Unity from “Bleeding Through” to 3D Objects Behind Them
  • Make objects like wires and cables easily in Unity using Ciihuy Curved Mesh
  • [SOLVED] Can’t Add Custom Domain to Blogger After Losing CNAME Verification
  • iOS App Icon Generator by CiihuyCom
© 2026 ThirteeNov | Powered by Superbs Personal Blog theme