Apache to ISS
-
Hi,
I designed a WP theme on an Apache server and I’ve now moved it over to an IIS server for my client.I fixed the permalinks situation, so I think the permissions are fine. But I have a few template files with a php loop:
<?php for($i=1; $i<7; $i++){ //loop 6 times if(get_field('image_' . $i)){ //check if there is an image on each iteration of the loop echo' <a href="' . get_field('image_' . $i) . '"';?> rel="lightbox[<?php the_title(); ?>]"> <? echo' <img src="' . get_field('image_' . $i) . '"/></a>'; //output results } } ?>
If the loop is there, I get a blank page. Nothing at all.
If I remove it, everything works fine.I have a similar code loop on the homepage and it works fine.
Any help would be greatly appreciated.
PS:
The code pulls custom variables from posts (to display images) of a particular category.Again, it works fine on Apache.
-
By the way here is a template/template block comparison:
WORKS:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <div class="entry"> <?php for($i=1; $i<11; $i++){ //loop 6 times if(get_field('image_' . $i)){ //check if there is an image on each iteration of the loop echo' <img src="' . get_field('image_' . $i) . '"/>';} } ?> </div> </div> </div> <?php endwhile; endif; ?>
DOES NOT WORK:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <div class="entry"> <div id="image_gallery2" style="float: right;"> <?php for($i=1; $i<7; $i++){ //loop 6 times if(get_field('image_' . $i)){ //check if there is an image on each iteration of the loop echo' <a href="' . get_field('image_' . $i) . '"';?> rel="lightbox[<?php the_title(); ?>]"> <? echo' <img src="' . get_field('image_' . $i) . '"/></a>'; //output results } } ?> </div> <div style="width: 680px;"> <?php the_content(); ?> </div> </div> </div> </div> <?php endwhile; endif; ?>
UPDATE:
I removed this line:
echo' <a href="' . get_field('image_' . $i) . '"';?> rel="lightbox[<?php the_title(); ?>]"> <?
and it all loads up..but this means I cannot use the LIGHTBOX popups..
anybody know of a lightbox issue with IIS?
- The topic ‘Apache to ISS’ is closed to new replies.