Use Wordpress for Static Website

I want to create a static website and only use wordpress to "layout" the website. I want to create a template that will only use the same header and footer and also change the content of the page (home, contact ecc dcc). My site is not a blog or any other type of site that requires a CMS. I only want to use Wordpress so I only have one header and footer, and don't want to change it across all pages when I need some kind of customization. Hope I was clear enough! Thank!

+3


source to share


6 answers


In Settings | Reading admin, choose a static page to display on the main page. Build your site using pages instead of posts. Each page will inherit the default and header of your site. Create a main menu from Appearance | Admin menu to link your pages. Use widgets and standard HTML links as needed. Then dress up your site with one of the many themes available.



+2


source


You can create a site in WordPress (or any other CMS) on your local machine and then save a copy using a standalone browser like HTTrack . Then upload the HTTrack saved HTML to your web host.

This will make your site faster as there will be no need to run PHP on page requests and the web server will use its default caching headers. (Plus, you get the option to use cheaper hosting without PHP and MySQL support.)



Every time you change site, you need to edit the live version of WordPress, save it again and re-upload it.

+5


source


Disclaimer: I am the developer of the WP Static HTML Output project .

It has been around for a few years and still has 5k + active installations, but now it adds some additional functionality and its whole purpose is to allow you to use WordPress to develop your site and export to a static HTML version for speed, security and portability.

The OP may find the basic FTP publishing option helpful. For more complex cases, there are services like Netlify that can auto build / deploy your static site from a Git branch.

+3


source


A bit late to the table on this, but it seems like Wordpress is completely overwhelmed for a static site. Wordpress pages can be cached using cache modules, but when loading any wordpress site, there are many scripts and custom php functions that run every time the page is loaded.

Why not just build a flat file site and just include your header and footer in PHP? Much faster to set up and based on your question it seems like this is just what you need.

In addition to that, you will not have an admin zone for your site or database, namely files on the server - this certainly makes your site less hacked. An added bonus is a really simple site for version control with Git or SVN.

+1


source


If anyone else wants to use a static site generator on top of Wordpress, here's the script called WP Static, which does just that: http://mossiso.com/code/make-wordpress-static

0


source


Another great solution to this problem is to use a specific software that is designed to do just that. For example, for the Mac, there is a software called Hammer that "compiles" your site every time you save and includes your page header and footer. Really useful.

0


source







All Articles