Time for action – fixing our code

The next step is to fix the code we've identified as the cause for the problem.

  1. The code causing the problem is the link which reads:
    <a href="" title="View all posts in Resources" rel="category tag">Resources</a>
  2. This is being generated by the the_category() template tag.
  3. The best way to find out what this tag does is to check out its Codex page at http://codex.wordpress.org/Function_Reference/the_category and its source code in the category-template.php file, which is a part of the core WordPress installation (you can see this at http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/category-template.php—it's daunting, so be warned!).
  4. Through my investigations I've discovered that this markup is generated by WordPress and not by my theme. I, therefore, have two options, either I can live with it, or I can delete that template tag.
  5. In this case, let's delete the tag to get the theme to validate. Select the following code in your index.php file and delete it:
    in <?php the_category(", ") ?>
  6. Save your index.php file and repeat the validation process at http://validator.w3.org/.

What just happened?

Having identified the offending code, we found out how it was being generated and removed it. If the code is generated by your theme's markup rather than by WordPress, you may find that you can change it instead of deleting it.

Note

If you ever come across problems like this which are thrown up by WordPress, you can always go to the WordPress trac site at http://core.trac.wordpress.org to see if a ticket has been raised about it, or you can submit one yourself. In this case, there is a ticket at http://core.trac.wordpress.org/ticket/17632.

Now let's see what the validator makes of our page:

What just happened?

Validating CSS

Now that we have valid HTML5 markup, we can move on to checking the CSS.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.91.44