Chapter 5. Debugging and Validation

In this chapter, we'll cover the advantages of debugging and validating your theme. We'll learn about validation and the validation services available online, and use them to validate our theme. Then we'll cover browser compatibility—a look at some of the most common reasons why markup and CSS don't always work how you expect them to, especially in Internet Explorer (IE) , and the various ways to remedy the problems.

As you work further and develop your own WordPress themes, you'll find that things will be much smoother if you debug and validate at each step of your theme development process, using a process we'll cover in detail in this chapter.

Depending on how your theme fares when validated and tested, you may not need to follow all of the steps here, but you may find them useful at a later date.

So let's get on with it.

Debugging and validation workflow

It's a good idea to adopt a consistent workflow when it comes to testing your code, which could look something like the following:

  • Add some code
  • Check if the page looks good in a modern browser
  • Validate
  • Check it in IE and other browsers you're using
  • Make any necessary changes
  • Validate again, if necessary
  • Add the next bit of code
  • Repeat, as necessary, until your theme is complete

So, having added your code, the first step is to validate and debug it. Let's look at some browser tools you'll use to help you do this, and then have a look at validation.

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

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