2015-02-11 3 views
0

Любая идея, почему приведенный ниже код загружает только миниатюру в наложение fancybox? Массив изображения в пределах .portfolio-slideshow загружается в фоновом режиме, он просто не запускается правильно с fancybox. Wordpress код:wordpress load fancybox image array

<a class="fancybox" href="<?php print $slideshow['guid']; ?>" rel="<?php the_title(); ?>"> 
     <?php 
      if (has_post_thumbnail()) { // check if the post has a Post Thumbnail assigned to it. 
       the_post_thumbnail(); 
      } 
     ?> 

     <div class="portfolio-slideshow"> 
      <?php 
       $slideshow = get_custom_field('portfolio_images:to_array', 'get_post'); 
       foreach($slideshow as $img) { 
      ?> 
       <img src="<?php print $img['guid']; ?>" /> 
      <?php } ?> 
     </div> 

     <h4><?php the_title(); ?></h4> 
    </a> 

ответ

0

Я должен был обернуть массив изображений в ссылке FancyBox + титул rel, это сделал трюк:

<div class="portfolio-slideshow"> 
    <?php 
     $slideshow = get_custom_field('portfolio_images:to_array', 'get_post'); 
     foreach($slideshow as $img) { 
    ?> 
      <a class="fancybox" href="<?php print $img['guid']; ?>" rel="<?php the_title(); ?>"><img src="<?php print $img['guid']; ?>" /></a> 
    <?php } ?> 
</div> 

<a class="fancybox" href="<?php print $img['guid']; ?>" rel="<?php the_title(); ?>"> 

<?php 
    if (has_post_thumbnail()) { // check if the post has a Post Thumbnail assigned to it. 
     the_post_thumbnail(); 
    } 
?> 

<h4><?php the_title(); ?></h4></a> 
+0

Вы это делали наоборот;) – JFK