Reputation: 759
I don't know where to start with fixing this one. I have a dual boot server with Ubuntu and Windows. In Ubuntu, everything's working fine, but in Windows (using WAMP), I get mysterious PHP errors on some of my sites while others (using PHP) are working fine.
Ubuntu screenshot http://newplayproject.org/wp-content/uploads/2012/10/screenshot-windows.jpg
Because it's working perfectly in Ubuntu, I'm guessing there's not actually an error with my code, but I'm missing some PHP module on Windows. Any ideas?
In response to one of the comments, here's the contents of "loop-blog.php":
<?php
global $options;
foreach ($options as $value) {
if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
?>
<?php get_header(); ?>
<? if ($xs_enable_static_feature == "false") { ?>
<? } else { ?>
<img src="<?php header_image(); ?>" alt="Static Image" class="static-image" width="880" height="280" title="Static Image" />
<? } ?>
<? if ($xs_disable_slider== "true") { ?>
<? } else { ?>
<?php get_template_part( 'nivoslider' ) ?>
<? } ?>
<div id="main">
<h1>Latest Posts</h1>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); ?>
<div class="post">
<div class="postcontent">
<?
// Checks To See If, Thumbnails Are Disabled
if ($xs_disable_thumbnails_archieve == "true") { ?>
<?
//If Not Disabled, Show Thumbnails
} else { ?>
<div class="postimg">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/functions/timthumb.php?src=<?php
if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) {
echo $thumbnail[0];
} else {
$postimage = get_post_meta($post->ID, 'post-image', true);
if ($postimage) {
echo $postimage;
} else {
echo catch_that_image();
}
}
?>&h=<?php echo $xs_thumbnail_height ?>&w=<?php echo $xs_thumbnail_width ?>&s=1" width="<?php echo $xs_thumbnail_width ?>" height="<?php echo $xs_thumbnail_height ?>" alt="<?php the_title(); ?>" /></a>
</div><!-- /postimg -->
<? } ?>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
</div><!-- End Post Content -->
</div><!-- End Post -->
<?php endwhile; ?>
<?php endif; ?>
<?php
//Check For the Page Navi Plugin
if (function_exists('wp_pagenavi')) {
wp_pagenavi();
//Show Default Navigation if Page Navi Is Not Installed
} else { ?>
<div class="paginate">
<div class="paginate-left"><?php previous_posts_link('Newer Posts') ?></div>
<div class="paginate-right"><?php next_posts_link('Older Posts') ?></div>
</div><!-- /paginate -->
<? } ?>
</div><!-- End Main -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Upvotes: 0
Views: 227
Reputation: 121881
Look at this section:
<?php
//Check For the Page Navi Plugin
if (function_exists('wp_pagenavi')) {
wp_pagenavi();
//Show Default Navigation if Page Navi Is Not Installed
} else { ?>
<div class="paginate">
<div class="paginate-left"><?php previous_posts_link('Newer Posts') ?></div>
<div class="paginate-right"><?php next_posts_link('Older Posts') ?></div>
</div><!-- /paginate -->
<? } ?>
It looks like maybe you don't have balanced <?php
and ?>
PHP tags.
Not certain, but definitely something to check.
And definitely avoid the (obsolete, XML-incompatible) <? ... ?>
"short tag" form, if at all possible. It's definitely not something you want to use going forward.
IMHO...
Upvotes: 0
Reputation: 33697
My guess is that you don't have short_open_tag
enabled on Windows, thus missing some of the PHP blocks.
Check the output of phpinfo()
if short_open_tag
is turned On. If it's not, enable it in your php.ini file.
Upvotes: 4