Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reuse html for footer

I see multiple answers about creating php files in order to reuse headers/footers, but nothing specific enough. I can't seem to get it to work.

What exactly would the php file look like and what exactly would my html file look like (given the code as it currently is, below)? do I have to convert all my html files to php files in order to use the php include line?

<div id="footer2-wrap">  
    <div class="container">  
        <table id="header">  
            <tr>  
                <td class="phone-number"><span class='wsite-text wsite-phone'>Copyright 2015 | xxx Corporation</span></td>
            </tr>

                    </table>
    </div>

like image 574
user4378184 Avatar asked Oct 15 '25 03:10

user4378184


1 Answers

Create a new file with your footer data. Let's give it the name: footer.php:

<div id="footer2-wrap">  
    <div class="container">copyright etc...</div>
<div>

Then inside your master template (or index.php file), include the footer file:

include_once('footer.php');
like image 108
Bas van Dorst Avatar answered Oct 18 '25 04:10

Bas van Dorst



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!