0

Is there a way to write a php conditional in WordPress that says:

"If 'editor' is not filled out (i.e. empty), then, do some code..."

I know it's sort of a strange request but basically I have a portfolio set up where if I don't fill out the editor for a post (i.e. project), I don't want a certain link to show.

2
  • Are you talking about the post editor field or the property $post->post_content?
    – fuxia
    Apr 30, 2013 at 20:49
  • @toscho I'm referring to the post editor field in the dashboard where I write the posts.
    – Desi
    Apr 30, 2013 at 20:50

1 Answer 1

2

I'm using something of the sorts for delivering some standard default text if the post content is empty. Give this a whirl:

<?php if( $post->post_content != "" ) {
    //do something or show content
} else {
    //do something else
}?>
1
  • Sure thing. Glad I could help :D
    – NW Tech
    Apr 30, 2013 at 21:16

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.