I'm trying to pull the content from a post/page into a template file.
I'm using the following code, which works fine HOWEVER the content is pulled in regardless of whether it is set to 'live' or 'draft'.
Is there a way of checking to see whether the post is live before pulling in the content?
<?php show_post('Offers'); // Shows the content of the offers page. ?>
Thank you
Please note this function is being used...
<?php
function show_post( $path ) {
$post = get_page_by_path( $path );
$content = apply_filters( 'the_content', $post->post_content );
echo $content;
}
?>
show_post()a core WordPress function? I don't recognize it. – Chip Bennett Nov 19 '12 at 14:27show_postfunction online. No idea if it is the same function. – s_ha_dum Nov 19 '12 at 14:46