How to create a static Html site in wordpress? Urgent

I want to make a 3 to 4 page static site with html, css and javascript in wordpress.I don’t know much about php coding , moreover I don’t have access to my phpmyadmin area , so i don’t want to modify any php code.

Coz if do something wrong with php code , then i will be kicked out of admin area . So i am looking for any plugin or any other method that can be used to host a static html site in wordpress( managed WordPress hosting).
Any help would be appreciated.

You don’t need to change anything in WP to create a static page. That’s what WP calls “pages”.

But you can even do that outside WP and, if you’re running a blog, personalize WP menu so it adds the links to the static pages.

@molona you didn’t get me.
If i use the WP page built option then it will inherit it’s property from wordpress theme, but i don’t want to do that.

I want a static html site that doesn’t inherit anything from wordpress. It will be a 2, 3 page site.
All pages will have custom head and and body.
I am thinking of adding bootstrap and jQuery lib to make it interactive.

There should not be any wordpress code , everything from head to body a
Should be static html custom coded

To inherit something from the theme you use or not it is your option. It’s going to be your static page. You add the CSS that you want.

Having said that, it does make sense that it is coherent with the rest of the website. That’s why most people use the looks for static pages included in the theme.

And, again, that those static pages are controlled by WP (pages) or not (you make them and, if necessary, personalize the menu section in WP to add those links) is up to you.

The static pages don’t have to be in WP. Just in the menu. Well, if they’re need to be in the menu. Maybe they don’t need to be linked in the menu. :slight_smile:

If you are saying you want to do away with the wordpress site totally I would try downloading your site to your computer with something like: https://www.httrack.com/

This should create a static version of your site on your PC - no php, no database etc. Delete the Wordpress site and upload the one from your PC that you downloaded.

I’m not aware of a way to get rid of all the WP overhead from within wordpress itself… what you might do is build those pages from scratch and simply upload them to your WP root directory (or something).

Is this something you want to link to from your WordPress site? If so, build a static site in a separate directory (for example, called static_site), upload that to the root of your WordPress site and add a menu item to the WordPress site that has a custom URL(example.com/static_site).

2 Likes

Are you after something like this?

[quote=“Rechtech, post:4, topic:232018, full:true”]
I want a static html site that doesn’t inherit anything from wordpress. It will be a 2, 3 page site.
All pages will have custom head and and body.[/quote]

Assumptions
I should imagine your site has an Apache Server and WordPress follows all the latest PHP Frameworks and CMS conventions by having Apache redirect all HTTP Server Requests through to /index.php.

The root file, index.php checks the Apache $_SERVER['REQUEST_URL'] variable and calls the appropriate page.

One way to create a very simple HTML site is to follow these steps:

  1. rename the existing index.php to index-WORDPRESS,php so that you can always return to the old site.
  2. copy the following code to a new /index.php
<?php
  // index.php - 2016-07-30
  error_reporting(-1); 
  ini_set('display_errors','1');

$page = substr($_SERVER['REQUEST_URI'], 1);
  if( strpos($page, '.') ):
    $page = strstr($page, '.', true);
  endif;

switch($page):
  case "contact":
    require 'justhtml/contact.html';
  break;

  case "faq":
    require 'justhtml/faq.html';
  break;

  case "term":
  case "terms":
    require 'justhtml/terms.html';
  break;necessary
keep all th
  default:
    require 'justhtml/home.html';
endswitch;
exit;

  1. create a /justhtml directory under the root to isolate and not confuse your new HTML files.
  2. check out the following “Online Demo” link and open each page
  3. right-click each page, highlight and copy contents
  4. paste into new files located in the justhtml directory:
    home.html
    contact.html
    terms.html
    faq.html
    style-2016-07-30.css

Online Demo

You will now have four pages which can be called from your browser with or without the .HTML extension (Pretty URLs).

The files can also be called individually by prefixing with the justhtml/ path both with or without the .html extension

Example:

http://thisisatesttoseeifitworks.tk/justhtml/faq

Edit:
Added canonical links to each page.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.