• I searched long and hard for the answer to this, but to no avail. I am using the command <?php require(‘../wp-load.php’); get_header();
    ?> along with a config.php file to use the wordpress theme with outside php pages. the problem I am having is getting the pages to pass through the validator in this scenario.

    most of the errors are “document type does not allow element xxx here”

    you can see a page I am speaking of here
    https://www.nycriminallawyer.net/westchester/criminal_attorney.php

Viewing 1 replies (of 1 total)
  • Those errors are completely valid. Have you looked at the source code of your page??? It’s a complete mess. You’ve got the doctype, then the header (with a p tag in it which is not allowed) and then when that finishes there’s another doctype tag and the header starts all over again.

    You need to go back to your code and work out what HTML you need to get rid of. Remember that uisng get_header() will bring in all of the standard WordPress header elements, so do not add those anywhere in your code, or you will continue to get these errors.

Viewing 1 replies (of 1 total)
  • The topic ‘Validating WordPress while using wp-load.php’ is closed to new replies.