Conditional Meta Data & Custom Fields
-
Hi there,
I’m trying to set up some conditional code, where I’ve set up some custom fields and if they are used, I don’t want specific post meta data to display. The field I have set up is Byline, which is entered if the article isn’t by any of the authors of the system. This is the code I have so far. I can get the custom field to show up, but I can’t get the author to show up if no custom field is used. Can anyone tell me what I’m doing wrong?<?php if ($key="Byline") { get_post_meta($post->ID, $key, true); } else { echo 'the_author()'; } ?> Thanks in advance for your help.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Conditional Meta Data & Custom Fields’ is closed to new replies.