Implementation on index.php
-
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–
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
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Implementation on index.php’ is closed to new replies.