# Header.php and footer.php html structure based on the site content element

**URL:** <https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674>\
**Category:** Pinegrow WP\
**Created:** [January 21, 2023, 4:40pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674 "2023-01-21T16:40:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dom](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/dom/32/4887_2.png) [@Dom](https://forum.pinegrow.com/u/Dom)\
**Post date:** [January 21, 2023, 4:40pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674/1 "2023-01-21T16:40:35Z")

</div>

PG Desktop 7.1

I was looking at the php files generated by PG for a Wordpress theme and was taken aback by the following dialog.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/c/cfeaa8149a7d8a1c9ba146d9542ad0141bb964f2.png)

Given that this could well have been caused by my fooling around I quickly created a new project in the simplest form I could.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/9/9626eaeb4b87437ef875364a3918c254fce1603f.png)

I then enabled WordPress, filled out the basic settings, made the inner section Site content and saved everything.

I then opened up the header.php file and was greeted with the first dialog. On closing that I was left with this;

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/4/472c08a69df015e67a773c385a439756a0b8e270.png)

The section clearly isn’t terminated, but it clearly is in the index.html file, first anomaly. Second, to me at least, is what is the section doing in the header.php file anyway?

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)\
**Post date:** [January 21, 2023, 4:48pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674/2 "2023-01-21T16:48:04Z")

</div>

First question, from your project folder, how come you end up editing the header.php file which is only available in the theme folder after the export?

---

<div class="post-metadata">

**Author:** ![Dom](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/dom/32/4887_2.png) [@Dom](https://forum.pinegrow.com/u/Dom)\
**Post date:** [January 21, 2023, 4:50pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674/3 "2023-01-21T16:50:00Z")

</div>

I wasn’t editing, just looking, all in the process of learning what’s actually happening as I create a theme.

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)\
**Post date:** [January 21, 2023, 4:50pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674/4 "2023-01-21T16:50:37Z")

</div>

Then, my first thought is that the automatically generated header is finally only a part of the page, and it is not necessarily closed, depending on where the content site is defined. I’m not surprised that Pinegrow shows an error since semantically, for HTML, this file is incorrect 🙂

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)\
**Post date:** [January 21, 2023, 4:53pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674/5 "2023-01-21T16:53:49Z")

</div>

Note: My first question was not asked with an inquisitive purpose, it turns out that we have often had feedback from users who had defined the project folder as the theme export folder and one can easily imagine the mess that resulted 🙂

---

<div class="post-metadata">

**Author:** ![Dom](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/dom/32/4887_2.png) [@Dom](https://forum.pinegrow.com/u/Dom)\
**Post date:** [January 21, 2023, 4:56pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674/6 "2023-01-21T16:56:39Z")

</div>

Ok. So I then export the theme (with the given caveat that there damn all to it) which is in a completely different folder of a different physical drive and look at the header.php file there.

```auto
<!DOCTYPE html> 
<!-- Converted from HTML to WordPress with Pinegrow Web Editor. https://pinegrow.com -->
<html <?php language_attributes(); ?>> 
    <head> 
        <meta charset="<?php bloginfo( 'charset' ); ?>"> 
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">                   
        <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
        <meta content="Pinegrow Web Editor" name="generator">
        <?php wp_head(); ?>
    </head>     
    <body class="<?php echo implode(' ', get_body_class()); ?>">
        <?php if( function_exists( 'wp_body_open' ) ) wp_body_open(); ?> 
        <header data-empty-placeholder></header>
        <section data-empty-placeholder>

```

Section still isn’t terminated, but I’m also curious as to why it’s in the header anyway.

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)\
**Post date:** [January 21, 2023, 5:00pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674/7 "2023-01-21T17:00:02Z")

</div>

Please, can you post a screenshot of the tree view from the index.html page with all the wp smart actions visible?

---

<div class="post-metadata">

**Author:** ![Dom](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/dom/32/4887_2.png) [@Dom](https://forum.pinegrow.com/u/Dom)\
**Post date:** [January 21, 2023, 5:06pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674/8 "2023-01-21T17:06:17Z")

</div>

As requested.

![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/f/faaa5329840440feb36120dd61654a99c7d76772.png)

And just in case

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/3/3d1733a3379543673a1e779fcad465d213f8d223.png)

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)\
**Post date:** [January 21, 2023, 5:12pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674/9 "2023-01-21T17:12:17Z")

</div>

So this is normal.  
The header.php contains the opening of the element on which the site content action is assigned and the footer.php contains the closing of this element.

In your situation, the element is a section.

---

<div class="post-metadata">

**Author:** ![Dom](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/dom/32/4887_2.png) [@Dom](https://forum.pinegrow.com/u/Dom)\
**Post date:** [January 21, 2023, 5:17pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674/10 "2023-01-21T17:17:57Z")

</div>

And indeed it does, thanks for the explanation.

```auto

</section> 
       <footer data-empty-placeholder></footer> 
      <?php wp_footer(); ?> 
</body> 
</html>`

```

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)\
**Post date:** [January 21, 2023, 5:23pm UTC](https://forum.pinegrow.com/t/header-php-and-footer-php-html-structure-based-on-the-site-content-element/7674/11 "2023-01-21T17:23:27Z")

</div>


