WordPress.org

Ready to get started?Download WordPress

Forums

W3C error with wordpress gallery feature (2 posts)

  1. adamkinney
    Member
    Posted 4 years ago #

    When inserting a gallery from the media link in the add/edit page section my site comse up as NOT W3C complient, the error i get is <style> isn't allowed in <div> elements. what word press seems to be doing ins putting a style with in a div tag ( if there is on there). the gallery feature installs a style tag where ever the gallry is inserted creating this W3C error. is ther a fix for this and a diffrent way to use it so it doent happen?

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Try adding:

    // remove gallery css
    add_filter('gallery_style', create_function('$a', 'return "
    <div class=\'gallery\'>";'));

    to your theme's functions.php file. However, you will then have to add some basic gallery styling to your theme's stylesheet.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.