Title: W3 validation error
Last modified: December 27, 2020

---

# W3 validation error

 *  Resolved [zak87](https://wordpress.org/support/users/zak87/)
 * (@zak87)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/w3-validation-error-7/)
 * Hi,
 * There is one div wrapper which start in:
 * header-footer-elementor/themes/default/hfe-header.php
 * `<div id="page" class="hfeed site">`
 * and ends in:
 * header-footer-elementor/themes/default/hfe-footer.php
 * `</div><!-- #page -->`
 * And I think this div should be removed or to have 2 separated div’s – one for
   header and one for footer. Why? There is W3 validation error if I set just a 
   Header or just a Footer.
 * In first case the div will be opened in the “hfe-header.php” but not closed in
   the footer and in second case will be just one extra closed div in the footer–`
   </div><!-- #page -->`.
 * In both cases there will be validation error.
 * This is the first time that I am using your plugin to create a premium theme 
   and I want to use on one demo default theme header + custom footer created with
   your plugin – but there is W3 validation error. I can not submit theme with that
   error. It will be nice if this can be fixed. Thank you.
 * Great work by the way!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [zak87](https://wordpress.org/support/users/zak87/)
 * (@zak87)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/w3-validation-error-7/#post-13839023)
 * Me again.
 * Maybe this will also help someone else.
 * My “fix” for this is to add in my theme header one check if the **hfe_footer_enabled**
   is set and to add one extra div tag in my header.
 *     ```
       <?php if ( function_exists( 'hfe_footer_enabled' ) ) {
         if ( hfe_footer_enabled() ) {
          echo '<div id="page" class="hfeed site">';
           }
         } ?>
       ```
   
 * The same thing should be in my theme footer to check if the header is enabled(
   and footer is not) to add one extra closing div tag:
 *     ```
       <?php if ( function_exists( 'hfe_header_enabled' ) ) {
        if ( hfe_header_enabled() ) {
          echo '</div>';
          }
        } ?>
       ```
   
 * So, with this solution, there is no more “self-closed”/unclosed div’s and no 
   more W3 validation errors.
 * Best
 *  Plugin Support [Team Brainstorm Force](https://wordpress.org/support/users/brainstormteam/)
 * (@brainstormteam)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/w3-validation-error-7/#post-13847862)
 * Hello [@zak87](https://wordpress.org/support/users/zak87/),
 * Thank you for getting in touch with us!
 * As you stated, in the case if the header is default and the footer is custom 
   or vice versa, we can add an opening/closing <div> tag in the header/footer respectively.
 * I am glad that you found a solution, however, it is not recommended to edit the
   current theme’s header/footer files as those will get overwritten with the theme’s
   next update.
 * This also can be done with the help of a few action hooks. Please let us know
   if you need further assistance with this.
 * Regards,
    Prajakta Suryawanshi

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘W3 validation error’ is closed to new replies.

 * ![](https://ps.w.org/header-footer-elementor/assets/icon-256x256.gif?rev=3278750)
 * [Ultimate Addons for Elementor](https://wordpress.org/plugins/header-footer-elementor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/header-footer-elementor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/header-footer-elementor/)
 * [Active Topics](https://wordpress.org/support/plugin/header-footer-elementor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/header-footer-elementor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/header-footer-elementor/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Team Brainstorm Force](https://wordpress.org/support/users/brainstormteam/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/w3-validation-error-7/#post-13847862)
 * Status: resolved