{"id":3114,"date":"2022-09-13T13:08:16","date_gmt":"2022-09-13T08:08:16","guid":{"rendered":"https:\/\/www.edopedia.com\/blog\/?p=3114"},"modified":"2022-09-13T13:08:18","modified_gmt":"2022-09-13T08:08:18","slug":"display-photos-from-your-facebook-album-using-jquery-plugin","status":"publish","type":"post","link":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/","title":{"rendered":"Display Photos From Your Facebook Album Using jQuery Plugin"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Available Options<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>albumURL<\/strong>&nbsp;(required): full URL to a Facebook Album<\/li><li><strong>limit<\/strong>: limit to the last X photos (default: 10)<\/li><li><strong>CSS<\/strong>: CSS styles to apply to every image<\/li><li><strong>imgSize<\/strong>: size of the image (default: medium)<ul><li>original<\/li><li>huge<\/li><li>x-large<\/li><li>large<\/li><li>medium<\/li><li>small<\/li><li>x-small<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>For more information on image sizes, check out the\u00a0<a href=\"https:\/\/developers.facebook.com\/docs\/graph-api\/reference\/photo\">Facebook Graph Photos API<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use?<\/h2>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">$(&quot;#slideshow a&quot;).facebookAlbumPhotos({\n\t'albumURL': 'https:\/\/www.facebook.com\/media\/set\/?set=a.451566814872131.116852.266818906680257',\n\t'limit': '6',\n\t'CSS': 'opacity:0;',\n\t'imgSize': 'huge'\n});<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Access Facebook Album with jQuery &#8211; Source Code<\/h2>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">&lt;html&gt;\n\t&lt;head&gt;&lt;\/head&gt;\n\t&lt;body&gt;\n\t\t&lt;div id=&quot;slideshow&quot;&gt;&lt;a href=&quot;#&quot;&gt;&lt;\/a&gt;&lt;\/div&gt;\n\t\t&lt;script src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.9.1\/jquery.min.js&quot;&gt;&lt;\/script&gt;\n\t\t&lt;script src=&quot;fb-photos.js&quot;&gt;&lt;\/script&gt;\n\t\t&lt;script&gt;\n\t\t\t$(document).ready(function(){\n\t\t\t\t$(&quot;#slideshow a&quot;).facebookAlbumPhotos({\n\t\t\t\t\t'albumURL': 'https:\/\/www.facebook.com\/media\/set\/?set=a.451566814872131.116852.266818906680257',\n\t\t\t\t\t'limit': '6',\n\t\t\t\t\t'CSS': 'opacity:0;',\n\t\t\t\t\t'imgSize': 'huge'\n\t\t\t\t});\n\t\t\t});\n\t\t&lt;\/script&gt;\n\t&lt;\/body&gt;\n&lt;\/html&gt;<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">(function($){\n\t$.fn.facebookAlbumPhotos = function(options) {\n\t\tvar settings = $.extend(options);\n\t\treturn this.each(function() {\n\t\t\tvar albumID = settings.albumURL.replace(\/.*(a\\.)([0-9]+).*\/,&quot;$2&quot;);\n\t\t\tvar photoLimit = settings.limit||10;\n\t\t\tvar target = $(this);\n\t\t\tvar imgStyle = settings.CSS||'';\n\t\t\tvar imgSizes = {'original':1,'huge':2,'x-large':3,'large':4,'medium':5,'small':6,'x-small':7};\n\t\t\tvar imgSize = imgSizes[settings.imgSize]||5;\n\t\t\t$.getJSON('https:\/\/graph.facebook.com\/'+albumID+'\/photos?callback=?',function(json,status,xhr){\n\t\t\t\tif(json.data.length&lt;photoLimit) {\n\t\t\t\t\tphotoLimit = json.data.length;\n\t\t\t\t}\n\t\t\t\ttarget.html(''); \/\/ empty the target element\n\t\t\t\tif (!target.is(&quot;a&quot;)) { \/\/ create an anchor tag linking to the album that holds all the images\n\t\t\t\t\ttarget.append(&quot;&lt;a href='&quot;+settings.albumURL+&quot;'&gt;&lt;\/a&gt;&quot;);\n\t\t\t\t\ttarget = target.children(&quot;:first&quot;);\n\t\t\t\t}\n\t\t\t\tfor(i=json.data.length-1;i&gt;=json.data.length-photoLimit;i--) { \/\/ load all the images\n\t\t\t\t\ttarget.append(&quot;&lt;img src='&quot;+json.data[i].images[imgSize].source+&quot;' alt='Slideshow image' style='&quot;+imgStyle+&quot;'\/&gt;&quot;);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t};\n})( jQuery );<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Available Options albumURL&nbsp;(required): full URL to a Facebook Album limit: limit to the last X photos (default: 10) CSS: CSS styles to apply to every image imgSize: size of the image (default: medium) original huge x-large large medium small x-small For more information on image sizes, check out the\u00a0Facebook Graph Photos API. How to Use? &#8230; <a title=\"Display Photos From Your Facebook Album Using jQuery Plugin\" class=\"read-more\" href=\"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/\" aria-label=\"Read more about Display Photos From Your Facebook Album Using jQuery Plugin\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":1762,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[112],"tags":[],"class_list":["post-3114","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Display Photos From Your Facebook Album Using jQuery Plugin<\/title>\n<meta name=\"description\" content=\"Available Options albumURL&nbsp;(required): full URL to a Facebook Albumlimit: limit to the last X photos (default: 10)CSS: CSS styles to apply to every\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Display Photos From Your Facebook Album Using jQuery Plugin\" \/>\n<meta property=\"og:description\" content=\"Available Options albumURL&nbsp;(required): full URL to a Facebook Albumlimit: limit to the last X photos (default: 10)CSS: CSS styles to apply to every\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/\" \/>\n<meta property=\"og:site_name\" content=\"Edopedia\" \/>\n<meta property=\"article:author\" content=\"trulyfurqan\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-13T08:08:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-13T08:08:18+00:00\" \/>\n<meta name=\"author\" content=\"Furqan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Furqan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Display Photos From Your Facebook Album Using jQuery Plugin","description":"Available Options albumURL&nbsp;(required): full URL to a Facebook Albumlimit: limit to the last X photos (default: 10)CSS: CSS styles to apply to every","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/","og_locale":"en_US","og_type":"article","og_title":"Display Photos From Your Facebook Album Using jQuery Plugin","og_description":"Available Options albumURL&nbsp;(required): full URL to a Facebook Albumlimit: limit to the last X photos (default: 10)CSS: CSS styles to apply to every","og_url":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/","og_site_name":"Edopedia","article_author":"trulyfurqan","article_published_time":"2022-09-13T08:08:16+00:00","article_modified_time":"2022-09-13T08:08:18+00:00","author":"Furqan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Furqan","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/#article","isPartOf":{"@id":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/"},"author":{"name":"Furqan","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/person\/3951cb19e3aa56df09e408c98aa02339"},"headline":"Display Photos From Your Facebook Album Using jQuery Plugin","datePublished":"2022-09-13T08:08:16+00:00","dateModified":"2022-09-13T08:08:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/"},"wordCount":74,"commentCount":0,"publisher":{"@id":"https:\/\/www.edopedia.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/02\/default_featured_image.jpg","articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/","url":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/","name":"Display Photos From Your Facebook Album Using jQuery Plugin","isPartOf":{"@id":"https:\/\/www.edopedia.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/#primaryimage"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/02\/default_featured_image.jpg","datePublished":"2022-09-13T08:08:16+00:00","dateModified":"2022-09-13T08:08:18+00:00","description":"Available Options albumURL&nbsp;(required): full URL to a Facebook Albumlimit: limit to the last X photos (default: 10)CSS: CSS styles to apply to every","breadcrumb":{"@id":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/#primaryimage","url":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/02\/default_featured_image.jpg","contentUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/02\/default_featured_image.jpg","width":880,"height":495,"caption":"Default Featured Image"},{"@type":"BreadcrumbList","@id":"https:\/\/www.edopedia.com\/blog\/display-photos-from-your-facebook-album-using-jquery-plugin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.edopedia.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Display Photos From Your Facebook Album Using jQuery Plugin"}]},{"@type":"WebSite","@id":"https:\/\/www.edopedia.com\/blog\/#website","url":"https:\/\/www.edopedia.com\/blog\/","name":"Edopedia","description":"Coding\/Programming Blog","publisher":{"@id":"https:\/\/www.edopedia.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.edopedia.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.edopedia.com\/blog\/#organization","name":"Edopedia","url":"https:\/\/www.edopedia.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2017\/10\/edopedia_icon_text_10.jpg","contentUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2017\/10\/edopedia_icon_text_10.jpg","width":400,"height":100,"caption":"Edopedia"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/person\/3951cb19e3aa56df09e408c98aa02339","name":"Furqan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e5e68aef3ad8f0b83d56f4953c512c8e57bd2e6dc64daec33b5d0495d9058f51?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e5e68aef3ad8f0b83d56f4953c512c8e57bd2e6dc64daec33b5d0495d9058f51?s=96&d=mm&r=g","caption":"Furqan"},"description":"Well. I've been working for the past three years as a web designer and developer. I have successfully created websites for small to medium sized companies as part of my freelance career. During that time I've also completed my bachelor's in Information Technology.","sameAs":["http:\/\/www.edopedia.com\/blog\/","trulyfurqan"],"url":"https:\/\/www.edopedia.com\/blog\/author\/furqan\/"}]}},"_links":{"self":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts\/3114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/comments?post=3114"}],"version-history":[{"count":1,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts\/3114\/revisions"}],"predecessor-version":[{"id":3115,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts\/3114\/revisions\/3115"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/media\/1762"}],"wp:attachment":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/media?parent=3114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/categories?post=3114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/tags?post=3114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}