This bit of code is for displaying related posts and resides in my includes folder.
I have recently switched from a local development environment on a Mac (using MAMP) to using Windows with WAMP.
Suddenly this error is occurring in this block of code. It did not occur on my local Mac environment, nor does it occur when testing live.
Parse error: syntax error, unexpected 'endif' (T_ENDIF)
The error specifically points to the second to last endif. If I remove it the same error is thrown pointing to the last endif in the code.
Any ideas? I tried removing both of the specified endif; statements and it throws the following error instead:
Parse error: syntax error, unexpected end of file
$orig_post = $post;
global $post;
$tags = wp_get_post_tags($post->ID);
?>
$tag_ids = array();
foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
$args=array(
'tag__in' => $tag_ids,
'post__not_in' => array($post->ID),
'posts_per_page'=>3, // Number of related posts to display.
'caller_get_posts'=>1 ,
'post_type' => array( 'post', 'featured-wedding' )
);
$my_query = new wp_query( $args );
?>
have_posts()): ?>
$post = $orig_post;
wp_reset_query();
?>
Answer
short_open_tag is probably not enabled in php.ini. You could set short_open_tag = On, however to be more portable, change:
To:
And you should change all other to .
No comments:
Post a Comment