/    Sign up×
Community /Pin to ProfileBookmark

How to use the same header/footer on all pages

hey guys ?

First post on the forums.

So I’m trying to use the same header/footer on all my pages of my website ([url]http://colorprise.com[/url])

I’ve created a header.html file, and tried to insert it via Jquery, SSI, and PHP, but no luck. It never shows.

Not sure exactly why. I want to make changes to the header as more features are enabled, but don’t want to make the changes to all 30+ pages everytime.

Any suggestions? Greatly appreciate it ?

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@jedaisoulApr 17.2017 — Hi and welcome to the site. The best way to handle headers, footers etc. is by using the PHP include facility. This is very easy to do:

  • 1. Put the header in a file e.g. "header.html" (as you have already done).

  • 2. Replace the header in each web page with:
    <i>
    </i>&lt;?php include 'header.html'; ?&gt;


  • If you are feeling brave,you could then:

    3. Check that you web hosting package includes PHP.

    4. Update your live site.

    However,I would recommend that you set-up an off-line test area first. To do that:

    5. Download and install one of the free development server packages (I recommend WampServer, for a Windows platform).

    6. Copy/move your web pages to ...wamp/www/userdir (where "userdir" is whatever name you want).

    7. Rename the web pages from "filename.html" to "filename.php".

    8. Launch WampServer (if it's not already running).

    9. Set up a shortcut (on the desktop or wherever) to launch the website locally:

    target: "localhost/userdir/index.php".

    10. Click the shortcut. You can then test the changes before putting them live.
    Copy linkTweet thisAlerts:
    @SheenaApr 26.2017 — You can use this code :-

    <style type="text/css">

    body {

    background-color: #CCC;

    margin:80px 80px 100px 100px;

    }

    div#fixedheader {

    position:fixed;

    top:0px;

    left:0px;

    width:100%;

    color:#CCC;

    background:#333;

    padding:20px;

    }

    div#fixedfooter {

    position:fixed;

    bottom:0px;

    left:0px;

    width:100%;

    color:#CCC;

    background:#333;

    padding:8px;

    }

    </style>
    Copy linkTweet thisAlerts:
    @direct_destinatApr 26.2017 — The 1st reply quite fully describes how it can be possible. But I put few notes .To such purposes never use <frame> in html code. If you are strugling with php, try to use popular cms instead. But i highly recommend getting some knowledge about it.
    Copy linkTweet thisAlerts:
    @foxprodesignsMay 04.2017 — Hello,

    Thanks for your question. I would love to suggest you kindly hire an expert who can solve your problem. Happy to help.

    Thanks
    ×

    Success!

    Help @dj2b4life spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.19,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...