smith116
Member
Posted 3 years ago #
I want to have two different post areas on my blog. I am setting up two authors and want them to have their own post spaces. I thought that I would modify our current theme's css to have two dedicated areas. I suppose what I need is an if, then, else statement in php to add to my index page. Can anyone demonstrate how to test the author variable in php and give it a conditional command? Thanks much.
http://codex.wordpress.org/Template_Tags/get_the_author
"Grabs the value in the user's Display name publicly as field. "
<?php
$author = get_the_author();
if ($author == 'User1') {
} else if ($author == 'User 2') {
} else {
}
?>
There are some other functions too, if you want to compare by other things, such as their email address.
smith116
Member
Posted 3 years ago #
Thanks!
I somehow just got it to work in query_post and then ran the loop again, query_post with a new author.