我有这一点php代码在我的wordpress主题,但我给我的是一个解析错误


I have this bit of php code in my wordpress theme But all i gives me is a Parse error

我在我的wordpress主题中有这段php代码,其中帖子的标签将被提取并按指定的不同颜色显示。但我得到的是一个解析错误。如果有人能帮忙,我会很感激的。

这是代码

<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-->

解析错误:语法错误,在C:'wamp'www'daily'wp-content'themes' daily Guide'widgets'widget-catlight.php第96行出现意外'endwhile' (T_ENDWHILE),而第96行是包含"

"的部分代码

打字错误:

代替if ($all_the_tags):

With: if ($all_the_tags) {

左、右花括号数目不匹配。

解析错误