WordPress.org

Forums

How do I fix validation problems? (4 posts)

  1. shylaz
    Member
    Posted 6 years ago #

    Hi!
    I am quite new to WordPress and have a few errors displayed when validated at W3's Validator page, but I can't figure out how to fix them. Could you help me and describe the "fixing method"?

    My site's validation results

    Thanks,
    Christoph

  2. scribblerguy
    Member
    Posted 6 years ago #

    Fixing the validation errors is equivalent to debugging a program. You have to go line by line and look for problems. The fact that WP uses dynamic template system with multiple files and pulls content from a database complicates the matter.

    When validating a theme, I find it easiest to to start with a simple page, such as a post page where the post's body contains only text, and you have all plugins disabled. Then, check that page and see what errors, if any, are present. You fix those errors and then move on by enabling plugins and trying other pages.

    Web page validation is all about finding coding errors, which for XHTML is mainly unclosed elements (such as <div> or <p>). You just have to check your theme's code and diligently search for problems.

    Though, even if the theme is valid, plugins that you use may not be coded to the highest of standards. These could introduce code errors, which could screw up the rest of your site. And, there's also a possibility that the visual editor may produce broken code in some circumstances. I mention all that because even if you design a valid theme, there are still ways for the pages that WP generate to be invalid.

    The Web Developer Toolbar extension and the Firebug extension for Firefox are useful tools for debugging web pages. There's also an official IE Dev Toolbar for Internet Explorer.

    If you have a good text editor (with features such as syntax highlighting, bracket matching, etc.) that greatly helps editing WP files.

  3. shylaz
    Member
    Posted 6 years ago #

    Thank you for your support!

  4. jaclynmarie1
    Member
    Posted 6 years ago #

    Umm.. I think you just need to fix this:

    <p style="text-align: center;"><div class="ngg-galleryoverview" id="ngg-gallery-1"><div id="ngg-image-1" class="ngg-gallery-thumbnail-box ">

    Remove the: <p style="text-align: center;"> and put the style thing on the DIV tag.

    That about eliminates your validation problems I believe.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.