The next step is to find the error, so that we can fix it.
<p class="entry-meta">by Rachel McCollin in <a href="" title="View all posts in Resources" rel="category tag">Resources</a>, <a href=" " title="View all posts in Software" rel="category tag">Software</a></p>
<div class="content">
, so I know they're in the main template file and not in one of the include files, such as sidebar.php
or footer.php
. Both lines 61 and 78 are displaying metadata and are enclosed in a <p class="entry-meta">
tag.index.php
. The PHP generating those two lines is inside the loop, which is shown below:<p class="entry-meta">by <?php the_author_meta('first_name'), ?> <?php the_author_meta('last_name'), ?> in <?php the_category(", ") ?></p>
We opened the page we checked with the validator, identified the code causing the problem, and then found the PHP generating that code n the template file.
Sniffing out PHP from the HTML it generates in this way may seem a bit daunting at first, but the trick is to find HTML elements which form major areas of the site, such as <div class="content">
. Then you can identify the HTML tags immediately surrounding the offending markup and trace that back to the PHP in the template file. If in doubt, always make a backup before you make any changes.