Frank
Frank

Reputation: 7

Dynamic footer integration

I'ld like to insert the footer of my website dynamically so I can add it to multiply pages without copy and paste it every time. I know an iframe can do it but I heard that's not a good solution and not working for seo. Can it be done with PHP or JavaScript?

Upvotes: 0

Views: 297

Answers (4)

Muhammad Ummar
Muhammad Ummar

Reputation: 3631

footer.php code as follows

<?php
//Write your custom footer here
?>

home.php code as follows

<?php

//All contents of Home page

include('footer.php');

?>

Upvotes: 2

KoolKabin
KoolKabin

Reputation: 17653

from php use include function

e.g: <?php include('inc/footer.php');?>

Upvotes: 0

BenMorel
BenMorel

Reputation: 36514

PHP is the right tool for this job:

<?php include('footer.php'); ?>

Upvotes: 0

circusbred
circusbred

Reputation: 1240

<?php include('path/to/footer.php'); ?>

Upvotes: 0

Related Questions