For every blog post I need to show the custom meta guest_author, if that is not set then default user.
This is what I want to do in PHP, please help
If guest_author is available echo guest_author else echo author
For every blog post I need to show the custom meta guest_author, if that is not set then default user.
This is what I want to do in PHP, please help
If guest_author is available echo guest_author else echo author
This is what I ultimately did:
<span class="post-info-text"><?php echo 'This interview was taken by: </span> <span class="author-name vcard fn author" itemprop="name">'; ?>
<?php $guest_author = get_post_meta(get_the_ID(), 'guest_author', true);
if (!$guest_author){the_author_posts_link();}else{echo $guest_author;} ?></span>