[[Title]]

[[content>>

The purpose of this page is to facilitate creating the header.php and footer.php files used by the CodeIgniter code.  When there is a new Divi theme, it is probably necessary to update both of those files.  The process is simple(?):

  • Disable all plugins that are not necessary on the CodeIgniter pages.  As I write this, the only plugin to keep is the one for accessibility. Record which plugins have been disabled.
  • View this page in a browser.
  • Capture the source of the viewed page, using the Page Source command of the browser.  Copy it to the clipboard.
  • Enable any plugins that were disabled in the first step.
  • Open a new document in BBEdit and paste the page source into it.  Everything above this content will be used to create header.php, and everything after this content will be used to create footer.php.
  • Duplicate ci/app/Views/templates/header.php and ci/app/Views/templates/footer.php.  These copies will be used as backup, and as reference for the changes that will be made.
  • Copy everything in the page source that precedes ‘[[content>>’ and replace the contents of header.php with it.
  • In the new header.php, remove unnecessary code, like the <script> tag that includes convertMetal()
  • In the Divi css for #main-content, remove ‘max-width:1080px;’
  • Replace [[Title]] with <?= esc($title); ?>, about six occurrences.
  • Insert <?= $header_extras ?> at the appropriate position near the end of the <head> block. (Consult header copy.php for guidance.)
  • Replace the top menu with <?= $top_menu ?>.
  • If the name of the current website is xxxx:
  • Replace all occurrences of http[s]://xxxx with <?= $base_url ?>
  • Replace //xxxx with <?= $base_url_bare ?>
  • Replace http:\/\/xxxx with <?= $base_url_escaped ?>
  • Replace http%3A%2F%2Fxxxx with <?= $base_url_encoded ?>
  • Save this header.php.
  • Copy everything in the page source that is after <<content]]’ and replace the contents of footer.php with it.
  • Make all of the same $base_url replacements as you made for header.php.  (Probably only $base_url will make any changes.)
  • Remove most of the theme footer: In the <footer> tag, remove everything except the footer-bottom that displays a single line with the Quality Casting copyright.
  • Save this as footer.php.
  • Try to load any CodeIgniter page, eg app/upload or app/orders.  If there are any issues, fix them and update this page to indicate how to fix them.
  • Enable the plugins that you disabled at the beginning.
  • Delete the header copy.php and footer copy.php files.

<<content]]

Skip to content