Title: [Plugin: Flexible Posts Widget] HTML Validation error in default widget.php
Last modified: August 20, 2016

---

# [Plugin: Flexible Posts Widget] HTML Validation error in default widget.php

 *  Resolved [Carsten Bach](https://wordpress.org/support/users/carstenbach/)
 * (@carstenbach)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-flexible-posts-widget-html-validation-error-in-default-widgetphp/)
 * Hi DaveE,
 * there is a small, but ugly, HTML error in your default widget template in /views/
   widget.php
 * You have the `echo $after_widget;` statement within your `if( $flexible_posts-
   >have_posts() )` conditional, so by default a closing </div> is missing and messes
   up the sidebar output.
 * **Before**
 *     ```
       [...]
       		</ul><!-- .dpe-flexible-posts -->
       <?php
       		echo $after_widget;
   
       else: ?>
       	<div class="no-posts dpe-flexible-posts">
       		<p>No post found</p>
       	</div>
       <?php
       	endif; // End have_posts()
       ?>
       ```
   
 * **After**
 *     ```
       [...]
       </ul><!-- .dpe-flexible-posts -->
       <?php else: ?>
       	<div class="no-posts dpe-flexible-posts">
       		<p>No post found</p>
       	</div>
       <?php
       		echo $after_widget;
       	endif; // End have_posts()
       ?>
       ```
   
 * I mentioned it while fetching a taxonomy with no posts in.
 * [http://wordpress.org/extend/plugins/flexible-posts-widget/](http://wordpress.org/extend/plugins/flexible-posts-widget/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [DaveE](https://wordpress.org/support/users/dpe415/)
 * (@dpe415)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-flexible-posts-widget-html-validation-error-in-default-widgetphp/#post-3119687)
 * Hi Carsten,
 * Well, that’ll make a guy feel a bit foolish. Thank you for pointing that out.
   I’ve updated the plugin with a correct source order for the if/else and the before/
   after widget.
 * Cheers!
 *  Thread Starter [Carsten Bach](https://wordpress.org/support/users/carstenbach/)
 * (@carstenbach)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-flexible-posts-widget-html-validation-error-in-default-widgetphp/#post-3119818)
 * He DaveE, great you fixed it so fast. Thanks and don’t feel foolish, you did 
   very good work with your Plugin at all.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Flexible Posts Widget] HTML Validation error in default widget.
php’ is closed to new replies.

 * ![](https://ps.w.org/flexible-posts-widget/assets/icon-256x256.jpg?rev=984592)
 * [Flexible Posts Widget](https://wordpress.org/plugins/flexible-posts-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flexible-posts-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flexible-posts-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/flexible-posts-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flexible-posts-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Carsten Bach](https://wordpress.org/support/users/carstenbach/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-flexible-posts-widget-html-validation-error-in-default-widgetphp/#post-3119818)
 * Status: resolved