Prevent a page caching
-
I have a couple of pages where I need to prevent cacheing as they have links to jpg files which change every 10 minutes. I’m using a child theme, I have created a custom page, and edited header.php in the child them to include this:
<?php echo '<!-- page template = ' . basename( get_page_template() ) . ' -->'; ?> <?php if ( is_page_template( 'pilot-nocache.php' ) ) { nocache_headers(); } ?> <!-- Yoast Breadcrumbs --> <?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb(' <p id="breadcrumbs">','</p> '); } ?> <!-- Custom Header - End --> <?php tha_header_bottom(); // custom action hook ?> </header><!-- .site-header --> <?php tha_header_after(); // custom action hook ?> <div id="content" class="site-content">
Is nocache_headers in the wrong place? Is there something more subtle to this?
I have checked the template name in the code is correct!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Prevent a page caching’ is closed to new replies.