davidbishop
Member
Posted 4 months ago #
Is there a way to have different author pages depending on the authors role. I.e. lets say a administrator has a certain author template, a editor has a different one, subscriber a different ones again, etc etc? Or just some sort of if statement within the same template displaying certain fields if the person that authors page belongs to is of a certain role display that field?
davidbishop
Member
Posted 4 months ago #
I found the following what I thought would do exact what I wanted but seems to do the exact opposite which I don't think it's supposed to! It shows contents by the role of whom ever is logged in and displays the logged in usernot the user on the authors page! I put this in fucntions then called it on the authors opage:
[Code moderated as per the Forum Rules. Please use the pastebin]
davidbishop
Member
Posted 4 months ago #
Sorry, here's the code with pastebin
http://pastebin.com/gAjzrynh
davidbishop
Member
Posted 3 months ago #
hi keesiemeijer,
thanks for the reply, but was wanting templates by user role rather then indivduly applying templates
davidbishop
Member
Posted 3 months ago #
[deleted] was being stupid, worked it out:
<?php $var = get_the_author_meta('user_level');
if ($var == 1) {
?> <b>Ranking:</b> <?php echo cp_module_ranks_getRank($authordata->ID); ?></br>
<?php }?>