Pinegrow lets you import the actual content of your local WordPress website into your theme’s source HTML files.
In our document How to setup Pinegrow for WordPress theme development we have covered the basics of a WordPress theme creation process with Pinegrow.
As you may know, Pinegrow WP does not access the WordPress database directly but at some point, instead of using fake text and dummy images, you may want to work with the actual content of your website, the question is How to import real content from a local WordPress into a HTML templates?
The solution is quite simple:
When you create a WordPress template, you have to define the WordPress site settings, and particularly the Preview page url.
Because Pinegrow can open and read external URLs, we use this mechanism to import the targeted content from any specific WordPress page that is set as Preview pages into the HTML template.
For example: You have created a custom single.html template and you want to import the real content from the main Loop of an existing post on your local WordPress into your HTML template.
Note: In WordPress template hierarchy, single.php is the template which is used when a visitor requests a single post.
From Pinegrow, open your single.html document and locate the WordPress site settings of your page. (select the the top level of the outline tree and check the Assigned action in the WP tab)
From your web browser, locate the URL of a single post on your local WordPress.
In our example : http:/locahost/pinegrow-wp-and-wordpress-custom-fields/
From Pinegrow, set Preview page url to the single post URL
Now, from the outline tree, locate your main loop action and select an element that you want to import. It can be The title, The excerpt, The content and any other content element.
Pro Tips: Proceed the elements one by one (the Title then the Content and so on … ). Selecting the complete loop will not work. Also, the selection is not limited to the content of the loop.
Let’s start with the Title element. When it is selected from the outline tree, use the Actions menu and select Import WordPress HTML.
If your local WordPress site is running properly and your preview page URL is correct in the settings, the Title from the post is imported into the HTML template.
And now, here is the result of the import of the Content element:
Isn’t that Convenient?
Last updated on December 2, 2015 at 12:51 am