OK, I’ve been trying to work this out myself through reading help pages and experimentation, but I’m growing frustrated, so I’ll ask for help.
I am rebuilding a site for someone in which a small number of editors post articles from a large number of different writers. Most of those writers are NOT registered users, but a few are. As I want the real author of the article to show up on the post, not necessarily the creator of the post, I use custom fields to specify the writer (name=”author”, value=author’s actual name). Then, in my theme files, I replaced:
So far so good. In any post that has a custom “author” field specified, the pseudo author is displayed instead of the post creator. However, in posts in which a pseudo author has not been specified, no author shows up on the post at all. This is understandable, since there is no code to call it, and I have not used a “then” statement of any sort to specify what happens “if” there us no custom key set.
I could just populate the custom field on every post, but since it interests me, I’d like to learn how to do satisfy the if/then condition for the sake of learning it.
I’ve tried to use this bit of code, but it seems not to work: