Is it possible to hide content in Post Preview (that is not hidden when the post is published)? I have customised single.php
quite extensively and there are a few elements that I do not want my authors to load up every time they preview their post.
1 Answer
There is the handy is_preview
function.
So somewhere in your single.php
.
<?php
if (!is_preview()) {
// Show stuff that doesn't belong on a preview.
}
-
Ah, I was not aware of that function, excellent!– Christine Cooper ♦Commented Jan 3, 2013 at 13:55