Display photos from Facebook posts on your website using the Facebook Graph API.
This will display the photos in an image gallery and allow users to see the photos without needing to go to Facebook directly.
Created for users of a website that don't have Facebook, but want to see daily photos posted by a business (e.g., a dog daycare).
- Facebook Page ID - How to Find Facebook Page ID
- Page Access Token - can obtain one through the Facebook Graph API Explorer
- Total number of photos to fetch from Facebook
- Number of photos you want to display per page
- Color codes for your website theme - update the CSS with your colors
- Paste the updated code from FBPhotoAlbum.html into a code block on your website (this was designed to be used with Squarespace)
- If you want to use the individual files, use FBPhotoAlbumHTML.html with the styles.css and script.js files as needed.
-
Add controls for navigating between photos within the lightbox modal -
Clean up code and divide into individual HTML, CSS, and JS files