Title: code invalid when inserting native WP gallery
Last modified: August 21, 2016

---

# code invalid when inserting native WP gallery

 *  Resolved [MissKitty9470](https://wordpress.org/support/users/misskitty9470/)
 * (@misskitty9470)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/code-invalid-when-inserting-native-wp-gallery/)
 * I have BlackStudio installed and am using it in my site’s sidebars.
    Example:
   [http://bit.ly/13ZJWyq](http://bit.ly/13ZJWyq)
 * It does not validate w/ HTML w3.org
 *     ```
       Line 134, Column 25: document type does not allow element "style" here
   
       		<style type='text/css'>
       ```
   
 * This is the code from HTML view of widget:
    `<p><span class="name">Ahh…Qua</span
   > Bed & Breakfast is a 4-acre hidden treasure, off the beaten path, but close
   to historic Plymouth, Massachusetts and 30 minutes to Cape Cod. <span class="
   name">Ahh…Qua</span> B&B is conveniently located near many favorite attractions.
   From important historical sites to beautiful beaches, from top notch function
   facilities to world class golf clubs, there is something for everyone. Perhaps
   you need some rest and recreation or maybe you have an upcoming event and need
   a place to stay. Make your event even more special by booking The <a href="accommodations/
   the-ahh-qua-bedroom/"><span class="name">Ahh…Qua</span> Bedroom</a> or <a href
   ="accommodations/the-sand-dollar-suite/">The Sand Dollar Suite.</a> You may never
   want to leave the B&B once you’ve experienced <span class="name">Ahh…Qua!</span
   > <a class="more-link" href="/accommodations">Explore Our Accommodations >></
   a></p>`
 * This is the code from view source:
 *     ```
       <div id="black-studio-tinymce-9" class="widget widget_black_studio_tinymce"><div class="widget-wrap"><h4 class="widgettitle">Come and Sea our B&B</h4>
       			<div class="textwidget">
       		<style type='text/css'>
       			#gallery-1 {
       				margin: auto;
       			}
       			#gallery-1 .gallery-item {
       				float: left;
       				margin-top: 10px;
       				text-align: center;
       				width: 33%;
       			}
       			#gallery-1 img {
       				border: 2px solid #cfcfcf;
       			}
       			#gallery-1 .gallery-caption {
       				margin-left: 0;
       			}
       		</style>
       		<!-- see gallery_shortcode() in wp-includes/media.php -->
       		<div id='gallery-1' class='gallery galleryid-363 gallery-columns-3 gallery-size-thumbnail'><dl class='gallery-item'>
       			<dt class='gallery-icon'>
       				<a href='http://ahhquabedandbreakfast.com/wp-content/uploads/2013/06/mbr.jpg' title='mbr'><img width="150" height="111" src="http://ahhquabedandbreakfast.com/wp-content/uploads/2013/06/mbr-150x111.jpg" class="attachment-thumbnail" alt="INDULGE in the luxuries of the Sand Dollar Suite" /></a>
       			</dt>
       				<dd class='wp-caption-text gallery-caption'>
       				INDULGE in the luxuries of the Sand Dollar Suite
       				</dd></dl><dl class='gallery-item'>
       			<dt class='gallery-icon'>
       				<a href='http://ahhquabedandbreakfast.com/wp-content/uploads/2013/06/breakfast-on-porch.jpg' title='breakfast-on-porch'><img width="150" height="111" src="http://ahhquabedandbreakfast.com/wp-content/uploads/2013/06/breakfast-on-porch-150x111.jpg" class="attachment-thumbnail" alt="ENJOY a full breakfast on the wrap-around porch" /></a>
       			</dt>
       				<dd class='wp-caption-text gallery-caption'>
       				ENJOY a full breakfast on the wrap-around porch
       				</dd></dl><dl class='gallery-item'>
       			<dt class='gallery-icon'>
       				<a href='http://ahhquabedandbreakfast.com/wp-content/uploads/2013/06/swing1.jpg' title='swing'><img width="150" height="111" src="http://ahhquabedandbreakfast.com/wp-content/uploads/2013/06/swing1-150x111.jpg" class="attachment-thumbnail" alt="NAP in the hammock or decompress on the swing" /></a>
       			</dt>
       				<dd class='wp-caption-text gallery-caption'>
       				NAP in the hammock or decompress on the swing
       				</dd></dl><br style="clear: both" />
       			<br style='clear: both;' />
       		</div>
       </div>
       		</div></div>
       ```
   
 * [http://wordpress.org/extend/plugins/black-studio-tinymce-widget/](http://wordpress.org/extend/plugins/black-studio-tinymce-widget/)

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

 *  Thread Starter [MissKitty9470](https://wordpress.org/support/users/misskitty9470/)
 * (@misskitty9470)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/code-invalid-when-inserting-native-wp-gallery/#post-3855133)
 * Oops…didn’t encode html widget code properly…
 *     ```
       <p><span class="name">Ahh…Qua</span> Bed & Breakfast is a 4-acre hidden treasure, off the beaten path, but close to historic Plymouth, Massachusetts and 30 minutes to Cape Cod. <span class="name">Ahh…Qua</span> B&B is conveniently located near many favorite attractions. From important historical sites to beautiful beaches, from top notch function facilities to world class golf clubs, there is something for everyone. Perhaps you need some rest and recreation or maybe you have an upcoming event and need a place to stay. Make your event even more special by booking The <a href="accommodations/the-ahh-qua-bedroom/"><span class="name">Ahh…Qua</span> Bedroom</a> or <a href="accommodations/the-sand-dollar-suite/">The Sand Dollar Suite.</a> You may never want to leave the B&B once you’ve experienced <span class="name">Ahh…Qua!</span> <a class="more-link" href="/accommodations">Explore Our Accommodations >></a></p>
       ```
   
 *  Plugin Author [Marco Chiesi](https://wordpress.org/support/users/marcochiesi/)
 * (@marcochiesi)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/code-invalid-when-inserting-native-wp-gallery/#post-3855212)
 * Hi MissKitty,
    Unfortunately this issue is not related to our plugin, but to 
   native WordPress galleries. You can try to disable our plugin and put your gallery
   inside a post or page and you should notice the same problem. There was a long
   discussion on the WP bug tracker about this issue: [http://core.trac.wordpress.org/ticket/10734](http://core.trac.wordpress.org/ticket/10734)
 * Possible solutions:
    [http://wordpress.org/plugins/gallery-shortcode-style-to-head/](http://wordpress.org/plugins/gallery-shortcode-style-to-head/)(
   plugin) [http://wpengineer.com/1802/a-solution-for-the-wordpress-gallery/](http://wpengineer.com/1802/a-solution-for-the-wordpress-gallery/)(
   custom coding)
 *  Thread Starter [MissKitty9470](https://wordpress.org/support/users/misskitty9470/)
 * (@misskitty9470)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/code-invalid-when-inserting-native-wp-gallery/#post-3855246)
 * Oh, ok! Thank you, Marco! I’ll try some of the solutions.
    🙂

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

The topic ‘code invalid when inserting native WP gallery’ is closed to new replies.

 * ![](https://ps.w.org/black-studio-tinymce-widget/assets/icon.svg?rev=2627604)
 * [Black Studio TinyMCE Widget](https://wordpress.org/plugins/black-studio-tinymce-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/black-studio-tinymce-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/black-studio-tinymce-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/black-studio-tinymce-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/black-studio-tinymce-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/black-studio-tinymce-widget/reviews/)

## Tags

 * [gallery](https://wordpress.org/support/topic-tag/gallery/)
 * [validate](https://wordpress.org/support/topic-tag/validate/)

 * 3 replies
 * 2 participants
 * Last reply from: [MissKitty9470](https://wordpress.org/support/users/misskitty9470/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/code-invalid-when-inserting-native-wp-gallery/#post-3855246)
 * Status: resolved