I have this bit of php code in my wordpress theme where tags of posts are to be fetched and displayed in different colors as specified. But all i get is a Parse error. I would be thankful if someone could help.
this is the code
<div class="category-light">
<?php $recent = new WP_Query(array( 'cat' => $categories, 'posts_per_page' => $number )); while($recent->have_posts()) : $recent->the_post();?>
<div class="cat-light-top">
<?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) { ?>
<a href="<?php the_permalink() ?>"><?php the_post_thumbnail('post-thumb'); ?></a>
<?php } ?>
<style type="text/css">
.poli {
color: #6868eb;
float: left;
font: 13px/10px oswald,helvetica, sans-serif;
margin-bottom: 5px;
padding-bottom: 5px;
text-transform: uppercase;
}
</style>
<?php
if ($all_the_tags);
$all_the_tags = get_the_tags();
foreach($all_the_tags as $this_tag) {
if ($this_tag->name == "politics" ) {
?>
<span class="poli" style="color:#5e6de0;">politics</span>
<?php } else if ($this_tag->name == "front" ) { ?>
<span class="poli" style="color:#a33030;">front</span>
<?php } else {
// it's neither, do nothing
?>
<!-- not tagged as one or the other -->
<?
}
}
}
?>
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?> </a></h2>
</div><!--cat-light-top-->
<?php endwhile; ?>
</div><!--category-light-->
Parse error: syntax error, unexpected 'endwhile' (T_ENDWHILE) in C:\wamp\www\daily\wp-content\themes\Daily Guide\widgets\widget-catlight.php on line 96, and line 96 is the part of the code that has ''