![]() |
How to include html code
What most webmasters do to include html code to their pages like a menu on top of every pages of the site that can be updated without manually change all these pages.
What is the right way to do this for seo, server speed and user friendly I need step by step details for server configuration Thanks in advance |
Quote:
|
What kind of site do you have? Purely HTML or is it handled through a content management system?
If it's the former, you need to look into HTML and CSS. http://www.w3schools.com/ That website is very helpful. |
You can either use a content management system (like Wordpress, or Joomla) or PHP.
To start make header.php, index.php, and footer.php, and then you can work on adding the rest of the sites (between the header and footer; site1.php, site2.php etc). You are going to use php "include", and as the index.php loads first you are going to add include 'header.php' and include 'footer.php' on the bottom of the index file. So basically you need to do it with php. Then you can start working on custom titles for every page etc. There is a lot of info about it on the Internet. |
Quote:
It depends on what you are building and what kind of framework (cms) you may be inside of. Each method has trade offs in speed, generally the more complex the scheme the longer it takes to complete. As far as seo and user friendliness that has everything to do with the actual web design and absolutely nothing to do with how you include the html code (unless you are doing something funky like having your pages written entirely from a javascript call. If you are doing that you are purposely not making it seo friendly.) . |
Thanks everybody for your answers
I saw websites using dynamic pages with .php and .html Using .html for dynamic pages can slowdown the server, is this true? |
what you are referring to is called php function include.
if same content on your site is gonna appear on many pages then you create a separate file for it and just use this code in pages, where you wanna sho it. <?php include(filename.php); ?> read some books on php and html, there are loads of material online and for free too. good luck. |
Ditto on php include function as others have said.
|
All times are GMT -7. The time now is 08:36 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc