Hi,
I've found myself with a WP challenge where I have to display something different depending on two categories and whether the user is logged in or not.
So there are 5 different permutations of delivering information. This is inside the loop on a custom page template.
If is in category "fruit" and user is logged in
do this
If is in category "fruit" and user is logged out
do this
If is in category "veg" and user is logged in
do this
If is in category "veg" and user is logged out
do this
elseif (is in another category other that fruit or veg and irrespective of whether they're logged in or not)
do this
For categories I use:
<?php if (in_category('veg')) { ?>
For user logged in I use
<?php if (is_user_logged_in() ) { ?>
But I can't combine the two.