Title: Implementation on index.php
Last modified: August 30, 2016

---

# Implementation on index.php

 *  Resolved [Brendan](https://wordpress.org/support/users/brezaling/)
 * (@brezaling)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/implementation-on-indexphp/)
 * Hi,
 * I read Philip S’s support question (Adding Featured Gallery to PinBin theme) 
   and have implemented what you posted there.
 * I’m trying to get the featured gallery into the index.php posts page…I think 
   I’m halfway there. But need a bit of help.
 * –
 * I’ve implemented this into my index page:
 *     ```
       <?php $galleryArray = get_post_gallery_ids(get_the_ID());
       $y = count($galleryArray);
   
           $returnedContent .= '<div class="galleryframe" data-selected="1" data-total="'.$y.'">';
   
               foreach ($galleryArray as $imageID) { $imageArray = wp_get_attachment_image_src( $imageID, 'large', 0 );
   
                   $returnedContent .= '<img style="background-image:url('.$imageArray[0].'); z-index:'.$y.'" data-order="'.$z.'">';
   
               $z++; $y--;}
   
               if ($z > 2) {
   
                   $returnedContent .= '<button class="arrow left"></button>';
   
                   $returnedContent .= '<button class="arrow right"></button>';
   
                   foreach ($galleryArray as $imageID) { $y++;
   
                       $returnedContent .= '<button class="nav'.($y==1 ? ' selected' : '').'" data-image="'.$y.'"></button>';
   
                   }
   
               }
   
           $returnedContent .= '</div>'; ?>
   
           <div class="galleryframe">
           <img style="background-image:url();>
           <img style="background-image:url();>
           <img style="background-image:url();>
           <img style="background-image:url();>
           <button class="arrow left"></button>
           <button class="arrow right"></button>
           <button class="nav selected"></button>
           <button class="nav"></button>
           <button class="nav"></button>
           <button class="nav"></button>
         </div>
       ```
   
 * –
 * See screen grab:
    [https://flic.kr/p/v5kxSt](https://flic.kr/p/v5kxSt)
 * –
 * It looks like it’s doing something but not pulling images into the container?
   
   I’ve added featured images to this post in the editor page – have I missed a 
   step?
 * I hope you can help.
 * Brendan
 * [https://wordpress.org/plugins/featured-galleries/](https://wordpress.org/plugins/featured-galleries/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Andy Mercer](https://wordpress.org/support/users/kelderic/)
 * (@kelderic)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/implementation-on-indexphp/#post-6259234)
 * Did you ever figure this out, Brendan? I’m not sure how I missed this thread 
   but I do apologize.

Viewing 1 replies (of 1 total)

The topic ‘Implementation on index.php’ is closed to new replies.

 * ![](https://ps.w.org/featured-galleries/assets/icon-256x256.png?rev=1073825)
 * [Featured Galleries](https://wordpress.org/plugins/featured-galleries/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/featured-galleries/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/featured-galleries/)
 * [Active Topics](https://wordpress.org/support/plugin/featured-galleries/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/featured-galleries/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/featured-galleries/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Andy Mercer](https://wordpress.org/support/users/kelderic/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/implementation-on-indexphp/#post-6259234)
 * Status: resolved