How to Create a New Page
Follow these steps to create a new page on the website:
1. Create a New PHP File
Create a new PHP file in the root directory of your project. Name it according to the page content, e.g., newpage.php.
2. Include the Header
At the top of your new PHP file, include the header.php file to ensure the page uses the same header layout as the rest of the site.
<?php include 'includes/header.php'; ?>
3. Include the Navbar
Next, include the navbar.php file. This will add the navigation menu to your new page.
<?php include 'includes/navbar.php'; ?>
4. Add Your Page Content
Write your content between the header/navbar includes and before the footer include. Use Bootstrap's grid system to structure your content.
<main class="container my-4">
<div class="row">
<div class="col-md-12">
<h2>Page Title</h2>
<p>Page content goes here.</p>
</div>
</div>
</main>
5. Include the Footer
Finally, include the footer.php file to ensure the page uses the same footer as the rest of the site.
<?php include 'includes/footer.php'; ?>
Example Code
Here is a complete example of a new page setup:
<?php include 'includes/header.php'; ?>
<?php include 'includes/navbar.php'; ?>
<main class="container my-4">
<div class="row">
<div class="col-md-12">
<h2>New Page Title</h2>
<p>This is where your new page content goes.</p>
</div>
</div>
</main>
<?php include 'includes/footer.php'; ?>