Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialChuong Nguyen
8,256 PointsHow to use validation on dynamic website like WordPress?
I'm building a website with WordPress, but wonder how to do validation because WordPress site is dynamic with lot of templates.
For example, I use W3C Markup Validation and it shows me the error:
Line 153, Column 25: No p element in scope but a p end tag seen.
<!--// meta slider--></p>
It's easy to check for a static website since the only file we need to look at is index.html, but I don't know where to find "line 153, column 25" to fix the above error. Would it be in the header.php, index.php, or it's in the meta slider code?
1 Answer
Mads Henning Nordbustad
2,917 PointsI have one idea that might make the process easier. When you input an url in the w3 validator, choose show source in options. This will output the source of the page you are validating with line numbers. Now you can see the line with the error in context which may be helpful for knowing where to find it in the wordpress code. Then simply go through all files where the error could possibly be and use ctrl-f to find the offending piece of code. It's a bit of a drag if you don't why where to start, which is the reason for my first suggestion.
Chuong Nguyen
8,256 PointsChuong Nguyen
8,256 PointsThanks for the answer, this process is time-consuming. I think this is one of the disadvantages of using dynamic CMS like WordPress, it's hard to find where is wrong in the code, at least for validation check. I don't know enough, so I hope someone else will add to this question.
Mads Henning Nordbustad
2,917 PointsMads Henning Nordbustad
2,917 PointsYou might want to check out Google Chrome DevTools if you havn't already.
Chuong Nguyen
8,256 PointsChuong Nguyen
8,256 Pointsthanks, I'll check it out.