How do I add my own static HTML pages to WordPress?
For example, let's say I have a page, products.html
, how would I add it to WordPress (any menu, etc.) and once added, how do I visit them, because WordPress had a typical URL structure?
What is a static front page? It's a homepage that doesn't contain blog posts or other regularly updated content. Instead, it's “static,” or unchanging. A static front page, also known as a “splash page” or “custom homepage,” can feature whatever you want.
WordPress is one of the most popular Content Management Systems out there, thanks to its dynamic functionality, extensive community and ecosystem, Open Source nature, and user-friendliness.
You do not need to install any additional plug-in. Just follow the following procedure and you are good to go.
Now, if you go the custom URL, you can find the static content you put in page-{ID}.php file.
If you (as the OP asked) want it to appear without having to add .html, simply create a folder at the same location where your WP site's index.php appears, and then name the file that you put inside that folder index.html.
Example, if you have a WordPress installation at doesnotexist.com and you want to add a static page, separate from your WP installation, that people can get to at doesnotexist.com/wedding - create the folder named wedding, and put the HTML in an index.html file inside the wedding folder. You also can then of course put other files in that folder or in folders within it so that the static page can reference images, styles, code, etc.
As someone said above, if the file for the URL exists, then WP won't get invoked to route the request. If you later remove the "wedding" folder or the "index.html" file from within it, anyone who tries to get to doesnotexist.com/wedding then would be routed to WP and, if no matching permalink was found, they'd see the 404 page not found error or whatever your theme or a plug-in is set up to show for broken links.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With