Single Html Page without CMS (wordpress) - html

I have a wordpress website (self hosted blog), but now I need to create a page like http://www.example.com/testpage.html.
How can I do this? How this person has done it? http://lukepeerfly.com/demos/iframe/html.txt

there are few ways to a "landing page" in your site. here's 2 methods:
1 - you can create a page in the cms and then make a template for it.
For example, we wanna make a page named "landing". We duplicate the page.php file in our theme and change his name to landing.php (as described here: http://codex.wordpress.org/images/1/18/Template_Hierarchy.png).
Then, in the page's code, in the top, we'll write the template name in the right syntax:
< ?php
/*
Template Name: landing
*/
?>
//other html/php code here
You can include the header, footer, sidebar, or choose not to include them.
the page url will be www.mysite.com/landing.
2 - The second way is to create a file outside your theme folder, in your server's root directory or in some designated folder (using a ftp connection, ofcourse). in the example you brought, http://lukepeerfly.com/demos/iframe/html.txt, html.txt is probably located in root\demos\iframe directory on the server.
your new file will be outside the wordpress. if you do want the file to be a part of your wordpress system (you need it if you want to use wordpress functions, hooks, database and etc) you'll need to include the "wp-load.php" file in the start of your code.
For example, our page, "landing.php", is directory "pages" in my root directory. in the page's code we'll write the following lines:
<?php
require('./../wp-load.php');
?>
//other html/php code here
In here as well, you can include the header, footer, sidebar, or choose not to include them.
the page url will be www.mysite.com/pages/landing.php.

you can just create the .html file and upload it to your FTP server and then link to it in your wordpress blog.

Related

How to load different parts of a web-page from different html files

I am making a local website where I have a number of pages with a lot of common code for header, navigation bar and footer.
I was wondering if there was a way I could use to store the header, footer and other such codes as independent html files, and then simply link them in the code for the new page.
You can use server-side includes for using an HTML file into another one. For that, you'll have to make a few changes in your server configuration as well. I'll show you an example of Apache.
Change configuration as mentioned in https://www.linuxtopia.org/HowToGuides/apache_ssi.html
Include the below code in your html file and replace "included.html" with your section html filename
<!--#include file="included.html" -->
Check more on : https://en.wikipedia.org/wiki/Server_Side_Includes

MEAN JS - where is the main html file (index.html) located

I just started learning MEAN JS and I am trying to find the html file for the main page. However I only see home.client.view.html and header.clinet.view.html in the view folder.
From what I know is, usually there is a main html which holds all the information of the home page, and we can add links of CSS files and JS files in the main html file.
How can I add links of extra CSS files and JS files in MEAN JS since i cannot find the main html file?
The MEANJS top level page is located under server/app/views/layout.server.view.html and is where you set header meta tags. Most everthing else on the page is programmatically inserted by angular, such as links to CSS files and Javascript files.
Any of the CSS or Javascripts files under your server/public directly are automagically added to the page. If you wish to add other, third-party scripts or stylesheets, you do so by editing your server configuration file, located at config/env/all.js.
So for example, to add the angular version of the tinymce editor to your MEANJS site, you'd edit config/env/all.js by adding CSS to module.exports.assets.lib.css and references to the tinymce editor and its angular wrapper to module.exports.assets.lib.js.
You will need to restart your server (via the 'grunt' command) if you change this file while the server is running.
UPDATE
Using mean-cli#0.6.1 to scaffold a new mean project, the default "top-level" page is located under packages/custom/meanStarter/public/views/system where you will find two files:
header.html - which describes the layout of the default navbar
index.html - which lays out the content of the default page
Now, having said that, it should be noted that the "proper" way of configuring a mean server to display your own top-level homepage is to create a new mean package.
See the docs for further information.

Custom wordpress theme

So I have been using the foundation framework to create my website. Its full of HTML,CSS,JS and images. I was looking at a tutorial from HTML to Wordpress conversion. I understanding having separate files called header.php, footer.php, aside.php and index.php.
What I don't understand that has not been spoken about is I have 3 pages in my website. HOME , ABOUTUS and FAQ. They all have the same footer and header. Is the index.php a template for the actual theme from which I can build upon to create the other pages or do I have to do this process manually for each file.
the index.php is your front page. The page.php file includes your pages but you have to create the file. Please read a tutorial how to do this. If you would like to create a page you should copy the content from your HOME, ABOUTUS, FAQ in the textfield in wordpress where you create your pages. HTML is allowed it should be no problem but you have to remove the header and footer from HOME, ABOUTUS and FAQ because you include it in your theme. If you would like to use a menu on your website which display the links to your pages you have to register a menu in your functions.php and to include it in the header, footer, page.php, index.php etc. But read a tutorial, please. After that you should know how to create a WordPress theme

Having html and wordpress on the same directory

I have a WordPress site with a couple of posts on it. To this site I need to add a few HTML pages (including index.html). I need both of them to work properly.
The home page should be the index.html page, and all its links(HTML pages).
The previous site URL's i.e. WordPress URL's should also work.
I put them together and the index.html page displays as home page, the subpages(HTML) also work fine. Although all WordPress URL's are re-directing to the index.html itself.
Is this possible? How do I make the old WordPress URL's work fine (i.e. not redirect the index.html page)?
When dealing with issues like this, I like to create page templates in Wordpress (with page names like About, Projects, etc.) And then I create a .php file using the slug title of it (so a projects page will correspond to a .php file called 'page-projects.php'
One example being I make a page called 'about', then I create 'page-about.php' in my Wordpress directory. The Wordpress Template Hierarchy will, along the way, look for a .php file called 'page-about.php'
A solution like this is great because those pages are linked through your site, so using /about or /projects will bring you to the proper pages instead of redirecting to the main page (because it redirects to your index when Wordpress can't find any other suitable template to display)

wordpress: how to add a custom static HTML page template?

is it possible with the dashboard to add custom static HTML files for generating new webpages ?
if not what's the easiest way ?
and how to make sure this pages are categorizable and also referencable on google search engine?
In Your theme directory You ca put some files, and name them like:
page-homepage.php
page-contact.php etc
Now, each of those files needs to open with:
<?php
/*
* Template Name: Contact Page
*/
?>
and this header needs to de diffrent for each file (it gves the termplate a name)
Now put any html You like inside (also consider adding get_header() and get_footer(), so You have all necesary scripts and mockup.
After creating those files, when editing a page in WP You can select the file as template.