Skip to content

Instantly share code, notes, and snippets.

@dotspencer
Last active May 17, 2016 22:59
Show Gist options
  • Save dotspencer/67609ee2ae65847c594b1f873699716f to your computer and use it in GitHub Desktop.
Save dotspencer/67609ee2ae65847c594b1f873699716f to your computer and use it in GitHub Desktop.
Custom wordpress php header for loading quickly the page for parsing
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="utf-8">
<?php
//if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' );
//wp_head();
?>
<body <?php body_class(); ?>>
<div class="page-container <?php if (get_field('layout_mode', 'option') == "boxed") { echo "page-boxed"; } ?>">
<div class="preloader"></div>
// Add this at beginning of page.php
<?php
if (isset($_GET['mode']) && $_GET['mode'] == 'quick'){
get_header('empty');
} else {
get_header();
}
?>
// This at end
<?php
if (isset($_GET['mode']) && $_GET['mode'] == 'quick'){
exit();
}
?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment