0

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 1

1

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.
}
1
  • Ah, I was not aware of that function, excellent!
    – Christine Cooper
    Commented Jan 3, 2013 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.