Thanks for the quick response!
In this case I’m actually changing meta tags that I need everyone to see. Won’t the current_user_can function only display that info to the current user instead of everyone else?
Can you kindly make it a bit clear.
This isn’t exactly the scenario because I think the exact scenario is harder to explain but if I can figure this out it will apply fine for what i need to do. So if this example is weird ignore the weirdness of it…
Users with the “this” role have custom profile fields labeled something like seo_title and seo_description. These fields are called in the header by:
<?php
if( isset( $_GET['author_name'] ) ) {
$profile_user = get_userdatabylogin($author_name);
} else {
$profile_user = get_userdata(intval($author));
}
?>
<title><?php echo $profile_user->seo_title; ?></title>
<meta name="description" content="<?php echo $profile_user->seo_description; ?>" />
They were applied to the correct user profile template by using:
is_archive( 'this' ))
But now we’ve added user role ‘that’ with different custom profile fields like seo_title_two and seo_description_two. We need to call those via the same fashion above but applied to the ‘that’ template.
I’ve tried adding is_archive( 'that' ))
below the other one but it doesn’t work. One is_archive seems to control both instead of them working independently. Hopefully that makes some kind of sense…
Thanks!
So I need users with the role “this” or author-this.php template to display seo_title and seo_description meta tags in the header.
Then I need users with the role ‘that’ or author-that.php template to display seo_title_two and seo_description_two meta tags in the header.
<?php } else if ( is_archive( 'this' )) { ?>
meta tags
<?php } else if ( is_archive( 'that' )) { ?>
different meta tags
isn’t working. They just show ‘this’ for both users or vica versa.