Using the_author in an If Statement
-
Hello,
I am trying to set up an if statement at the bottom of single.php which says that if the author is “Barbara”, show the sidebar, otherwise show a different sidebar. The code is working but the_author is showing at the top of the either side bar. I am pretty sure this is to be expected but I am not sure how to get around it. Can someone offer an explanation as to why its happening and fix for this?
Thanks.
<?php if (the_author()=="Barbara") get_sidebar(); else { include('sidebar-mentors.php'); ?> <?php } ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Using the_author in an If Statement’ is closed to new replies.