How to Create Custom Headers and Footers
From AMember Pro Manual
The easiest way to create custom header and footer is to start with an existing HTML page from your site. Follow these steps:
- Don't forget to back up the file templates/layout.html first!
- Open an existing page on your site and save it in a new name - say amtemplate.html
- Remove all the content you do not wish to include in the aMember pages (keep it just common header and footer).
- You need to change all the urls in the HTML from relative to absolute. Links, image paths and so on must all be changed. For example if you have a link to your home page that reads <a href="index.html"> this must be changed to <a href="http://www.yoursite.com/index.html">
- Similarly if you have an image called using <img src="../images/image.gif"> it needs to be amended to <img src="
"> (Alternatively you can edit all URLs to be relative from the root. This means all will begin with a forward slash - eg /images/image.gif)
- Now write the word HERE in the part of the page where you want the script pages to appear, this is usually the main part of the page.
- Edit your file and add before </head> the following code:
{php}echo amember_get_header_code();{/php}
- Open your page with a text editor.
- Open file templates/layout.html
- Edit file templates/layout.html and replace all above
{* Don not remove or modify anything between these lines *}
{$CONTENT}
{* Don not remove or modify anything between these lines *}
with content of the page which appears above the word HERE in your file
- Edit file templates/layout.html and replace all below
{* Don not remove or modify anything between these lines *}
{$CONTENT}
{* Don not remove or modify anything between these lines *}
with content of the page which appears below the word HERE in your file
- That is all!
