Skip to content

Instantly share code, notes, and snippets.

@mrwweb
Created October 7, 2016 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrwweb/5822e44ee6d0ad7a14e732dc9e42ae81 to your computer and use it in GitHub Desktop.
Save mrwweb/5822e44ee6d0ad7a14e732dc9e42ae81 to your computer and use it in GitHub Desktop.
Some pseudo-code for a response on NTEN WordPress Online Community Forum
<?php
add_action( 'wp_head', 'nten43561_html_meta' );
/**
* place custom meta in <head> of a WordPress site.
*
* Make sure to replace the "XX" below or else you'll get an error!
*
* @see https://community.nten.org/communities/community-home/digestviewer/viewthread?GroupId=571&MID=43561&tab=digestViewer&UserKey=3f274014-ea5f-4f43-a232-e59886306781&sKey=9dd0bd09908d46de93f9
*/
function nten43561_html_meta() {
$page_id = XX; // replace XX with the ID of the page not to cache
if( is_page( $page_id ) ) {
?>
<!-- replace these with whatever you want -->
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<!-- end of replacement area -->
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment