I'm trying to make a featured posts banner with the title of the posts hovering over thumbnail sized images. Unfortunately, I'm getting a very annoying parse error: Line 230 is the very last line. Here's the code snippet: //Main Banner function main_banner() { add_image_size('mycustomsize', 240, 160, true); $my_query = new WP_Query('category_name=featured&showposts=4'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; echo '<ul id="review-banner">'; echo '<li style="background: url('; the_post_thumbnail('mycustomsize'); echo ') no-repeat;"><h2><a href="URLToAPost">PostTitle</a></h2></li>'; echo '<li style="background: url('; the_post_thumbnail('mycustomsize'); echo ') no-repeat;"><h2><a href="URLToAPost">PostTitle2</a></h2></li>'; echo '<li style="background: url('; the_post_thumbnail('mycustomsize'); echo ') no-repeat;"><h2><a href="URLToAPost">PostTitle3</a></h2></li>'; echo '<li class="review-banner-last" style="background: url('; the_post_thumbnail('mycustomsize'); echo ') no-repeat;"><h2><a href="URLToAPost">PostTitle4</a></h2></li>'; echo '</ul>'; } PHP: Any help would be greatly appreciated.
You didn't close the while loop. //Main Banner function main_banner() { add_image_size('mycustomsize', 240, 160, true); $my_query = new WP_Query('category_name=featured&showposts=4'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; echo '<ul id="review-banner">'; echo '<li style="background: url('; the_post_thumbnail('mycustomsize'); echo ') no-repeat;"><h2><a href="URLToAPost">PostTitle</a></h2></li>'; echo '<li style="background: url('; the_post_thumbnail('mycustomsize'); echo ') no-repeat;"><h2><a href="URLToAPost">PostTitle2</a></h2></li>'; echo '<li style="background: url('; the_post_thumbnail('mycustomsize'); echo ') no-repeat;"><h2><a href="URLToAPost">PostTitle3</a></h2></li>'; echo '<li class="review-banner-last" style="background: url('; the_post_thumbnail('mycustomsize'); echo ') no-repeat;"><h2><a href="URLToAPost">PostTitle4</a></h2></li>'; echo '</ul>'; endwhile; } PHP: