Support » Plugin: Facebook Album » Sample Code – one facebook album

  • Resolved mrsburnside


    The directions I saw were geared to the person who wants to display multiple albums. I wanted to show one album. Here is my code for anyone else who wants to use it:

    function fbalbum_func() {
        $list = facebook_page_albums_get_photo_list('your-facebook-photo-album-number');
    function showCaption(fbpic) {
    	document.getElementById(fbpic).style.visibility = "visible";
    function hideCap(fbpic) {
    	var tfbpic = "fbpic" + fbpic;
    	document.getElementById(tfbpic).style.visibility = "hidden";
        <ul class="album-list" style="list-style: none; ">
            <?php $fbpic = 1;
    		foreach ($list as $item) : ?>
               <li class="album" >
    					<div style="position: relative;" onmouseover="showCaption('fbpic<? echo $fbpic;?>')" ><a href="<? echo $item['source']; ?>" rel="lightbox[fbpic]"><? echo "<img src='".$item['source']."' style='max-width:250px; max-height: 250px'>"; ?><br>
    					<? echo "<p id='fbpic$fbpic' style='background-color:#999; color: white; visibility: hidden;position: absolute; bottom:-5;' ";
    						echo 'onMouseOut="hideCap('.$fbpic.')"';
    						echo"'>".$item['name']."</p>"; ?></a></div>
    					<div  class="fbpic" style="position: relative; display: none;" >
    					<? echo "<img src='".$item['source']."' "; ?>
            <?php $fbpic++;
    <? }
    add_shortcode('fbalbum', 'fbalbum_func');

    Here is some sample CSS for the class .album:

    .album {float: left; margin: 10px; height: 270px; width: 270px; text-align: center; background-color: #ccc; padding: 5px;vertical-align: middle;}


Viewing 1 replies (of 1 total)
  • Plugin Author mglaman


    This plugin is meant to display one album per shortcode, not multiple. So not sure what this is?

Viewing 1 replies (of 1 total)
  • The topic ‘Sample Code – one facebook album’ is closed to new replies.