How to Optimize the Load Time of your One-Pagers

Posted · 2 Comments
PageLines DMS: Turning off header and footer via PHP

Sometimes you don’t want your site-wide (i.e. global) fixed, header, or footer regions to be visible.

The code in this post will show you how to disable these regions for specific pages.

PageLines DMS: Turning off header and footer via PHP

PageLines DMS: Turning off header and footer via PHP

Examples use cases include:

Your first thought might be to look for an option in PageLines DMS to disable the fixed, header, and/or footer areas just for that one page. However, there’s no option for that. There’s only a global checkbox option.

OK Option

So you might think to just do CSS display:none; to hide it, but this isn’t ideal because your header and footer are technically still being loaded in the browser, just not displayed.

Here’s the LESS CSS code for that (although it’s not recommended):

Best Option

But the best way is to just not load it on the page at all, which means we need some PHP code in our child theme’s functions.php.

Here’s the recommended way to accomplish this:

There you have it!

2 Responses to "How to Optimize the Load Time of your One-Pagers"
  1. Dude you are always sharing some useful stuff.
    Thank You.

Comments are closed.