Title: Default dynamic sidebar code invalidating my page
Last modified: August 19, 2016

---

# Default dynamic sidebar code invalidating my page

 *  Resolved [synchole](https://wordpress.org/support/users/synchole/)
 * (@synchole)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/default-dynamic-sidebar-code-invalidating-my-page/)
 * Hi,
    I recently added a dynamic sidebar to my company’s website (centurionsystems.
   com) in order to put the qtranslate widget I’m using in the sidebar and not in
   the footer where it was being lost. I added a text widget as well to make it 
   even clearer what the widget does. However, adding this makes my code invalid.
   I get these errors: `…" class="widget-container widget_text"><h3 class="widget-
   title">Change Languag… Element li not allowed as child of element div in this
   context. (Suppressing further errors from this subtree.)`
 * So it’s having difficulty with this:
 *     ```
       <li id="text-3" class="widget-container widget_text"><h3 class="widget-title">Change Language</h3>
       <div class="textwidget"><p>To View this site in another language, please use the drop down menu below.</p>
         199</div>
       ```
   
 * But since I’m only using this in my code:
 *     ```
       <?php if ( ! dynamic_sidebar( 'secondary-widget-area' ) ) : ?>
       		<?php endif; // end primary widget area ?>
       		</div><!-- #secondary .widget-area -->
       ```
   
 * I honestly don’t know how to fix this issue.
    Any help is greatly appreciated.

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/default-dynamic-sidebar-code-invalidating-my-page/#post-1910864)
 * Try amending the markup being used with your widgets in functions.php. You need
   to look at the register_sidebar function.
 *  Thread Starter [synchole](https://wordpress.org/support/users/synchole/)
 * (@synchole)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/default-dynamic-sidebar-code-invalidating-my-page/#post-1910985)
 * Brilliant! Thank-you!

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

The topic ‘Default dynamic sidebar code invalidating my page’ is closed to new replies.

## Tags

 * [dynamic sidebar](https://wordpress.org/support/topic-tag/dynamic-sidebar/)
 * [invalid code](https://wordpress.org/support/topic-tag/invalid-code/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)
 * [widgets](https://wordpress.org/support/topic-tag/widgets/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [synchole](https://wordpress.org/support/users/synchole/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/default-dynamic-sidebar-code-invalidating-my-page/#post-1910985)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
