Pinegrow Community Support Forum

Wordpress Template Export: Pinegrow Bug (or just me)?

Hey there!

I’m a seasoned developer, but new to both WP and Pinegrow, so not sure if this issue is me or the system. Opened some support tickets, but went un-replied, so opening it up to the community.

I have a master WP template, working well. I’m trying to add a second page to use as a blank WP Template in the “Templates” dropdown when creating new pages.

For the new HTML page in my project folder, I have set the following from the WP tab in Pinegrow:

  • Set the HTML element as Wordpress Site (not the Master, with index.html as “Use Master Page”)
  • Set the SECTION element as “The Loop”
  • Set the DIV inside the section as the “Site Content”
  • This “blank_page.html” page’s html content is: html head, body, blank header, section, content div, blank footer, closing body…

When I save, and Export Theme however, while it saves and creates the “blank_page.php”, it doesn’t export anything for the header / footer, but more importantly, the PHP content is missing “the_content” php call, and has “get_header” and “get_footer” instead of “wp_head” and “wp_foot”, so I get errors running pages using this template in WP:

The PHP template is simply:

<?php
/*
 Template Name: Blank Page (No header/footer)
 */
?>
<?php
get_header(); ?>


<?php get_footer(); ?>

Very well could just be me missing something obvious, but the get_header stuff shouldn’t happen, right (this is depricated in WP?)

Any ideas? Thanks very much!

  • Ira

Hi, I am new to all this myself. I have played around with css, html and php over the years I can usually sort minor issues with my own sites. I am disappointed that no-one here or in the proper support area has answered your question. I can recommend a book: Smashing WordPress (beyond the blog) by Thord Daniel Hedengren. It’s published by Smashing Magazine and I have found it very helpful. BTW I don’t get anything for recommending the book - it’s just a good book!

From what I understand (could be wrong!) you should keep the <?php get header(); ?> on one line shouldn’t you?

Hope you sort it or someone who has the answer replies soon.

Thanks for the reply, newbeltane! I’m slowly getting comfortable with WP, but if I get stuck, could check out the book.

For the PHP, it doesn’t matter if that code is on one line or not, it will be compiled as php code either way.

The real issue is that Pinegrow (for some reason) is buggy, and generating the wrong code for thcae header and footer. The code being generated (get_header) is deprecated Wordpress code. It should be generating wp_head & wp_footer.

But becasue this code is being generated by Pinegrow, any time I export the WP theme, it will overwrite anything I write with the wrong / outdated get_header & get_footer.

I can’t fix this myself, only the Pinegrow team go fix this in the source code, but they won’t even reply to my Forum or Email messages…

Cheers

Hi @ira242. I’ve had a look at this myself by creating a theme and saving/exporting it. When I view the content of index.php it contains both <?php get_headter(); ?> and <?php get_footer(); ?> as its supposed to do. Then when I view the contents of my header.php file I have the code <?php wp_head(); ?> in it and the same for footer, i.e. <?php wp_footer(); ?>

I also came across this information regarding the header.php file and wp_head in “Wordpress Themes in Depth” by Jeff Starr (current to Wordpress 4.7), full of great information:
The header.php file contains the beginning part of each web page, referred to as the “document head”, “header area”, “head area”, or whatever you prefer. header.php includes stuff like stylesheets, JavaScript files, meta tags, and the essential hook, wp_head().
The markup contained in header.php begins with the DOCTYPE and ends just before the main content. Specifically, after including header.php via get_header(), index.php runs the Loop, which is wrapped in a .container div. This modular structure makes it easy to include header.php in any primary template.

So as far as I can tell it is creating WP theme documents the way it is expected for Wordpress themes. I haven’t found anywhere that it says wp_head or wp_footer are deprecated but I could be wrong and it certainly wouldn’t be the first time that happened :slight_smile:

I don’t know if this is of any help… if not maybe add some more information about your issue and we’ll try and help you out.

Hi again @ira242. I just had a thought about your issue and I was wondering have you added the wordpress WordPress site action to the top node of the page in the outline tree (the node with the page name), this has changed since Pinegrow 2.4 but it mightn’t be updated everywhere in the Docs. This might be causing your issue!

I’m not sure I understand everything but if you want to create page templates, you have to add the Define Page Template action on your template.

http://docs.pinegrow.com/wordpress-themes/how-to-use-wordpress-pages-and-posts-templates

As for the headers and footers in Pinegrow, maybe you can have a look at this:
http://docs.pinegrow.com/wordpress-themes/5-things-you-should-know-about-wordpress-header-and-footer-in-pinegrow

1 Like

Hi all,

Just a quick note so say thanks for the info. I’m under some crazy deadlines, so cannot delve deeper until the weekend, but wanted to say that I really appreciate you all taking the time.

I’ll post back when I test your suggestions and run some more troubleshooting.

Cheers!

Ira @ The Red Eye

1 Like