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

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.

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

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;

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?

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?

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

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 :slight_smile:

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 :slight_smile:

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.

<!DOCTYPE html> 
<!--  Converted from HTML to WordPress with Pinegrow Web Editor. https://pinegrow.com  -->
<html <?php language_attributes(); ?>> 
        <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(); ?>
    <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.

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

As requested.


And just in case

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.

And indeed it does, thanks for the explanation.

       <footer data-empty-placeholder></footer> 
      <?php wp_footer(); ?> 
1 Like