Conditional tag question
-
Hi,
I couldn’t find anything that quite related to this on the forums, and I am fairly limited in my coding knowledge. I’m looking to set up some sort of condition such that if the author of a post is “admin” then a custom field I have designated as “hpbyline” is displayed. Otherwise, the designated author is displayed.
I have something close already, that works this way: If the author is “admin”, then NOTHING is displayed. How would I modify it so that
<?php echo c2c_get_custom(‘hpbyline’); ?> is displayed instead?Thanks for the help!
<?php $auth = get_the_author(); if ($auth != 'admin') : ?> <div class="byline"> By <?php if(function_exists('coauthors_posts_links')) coauthors_posts_links(); else the_author_posts_link(); ?> </div> <div class="bytitle"> <?php echo c2c_get_custom('Bytitle'); ?> </div> <?php endif; ?>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘Conditional tag question’ is closed to new replies.