how to add contributor label on their post

Posted in: Newspaper
Post count: 14

Hi,

Can anyone help me on this i want that if an contributor post their content then on the .td-module-meta-info will show up their role as contributor after their name like this > null

Post count: 6535

HI

Unfortunately thew theme does not have such an option but you can add a new meta to display contributor’s name: https://codex.wordpress.org/Function_Reference/add_post_meta After the meta is added use get_the_author_meta() in td_module_single_base.php to display it, here is a basic example: http://screencast.com/t/ZPu5VKe9

Note that this task involve some codeing skills and customizations in order to be achieved. We can’t offer customization services at the moment so if you still need guidance on this or you’re not aware of the steps you need to take in this regard please consider hiring a developer or a freelancer to do this for you.

Thanks!

Post count: 14

Hi,

contributor-meta-info is Not Showing anything what is the exact code for displaying “contributor”

Post count: 22421

Hello,

As Andrei suggested above, we cannot provide the exact code you need. This involves a bit of coding skills and we cannot do it for you. We can only guide you in the right direction. You will either have to give it a try yourself or hire a developer to help out as we cannot offer any customization services.

Thank you!

Post count: 14

I’ve Done That hehe.. 😉 using this code
//contributor
global $post;
if ( user_can( $post->post_author, 'administrator' ) ) {
echo 'Administrator';
} elseif ( user_can( $post->post_author, 'editor' ) ) {
echo 'Editor';
} elseif ( user_can( $post->post_author, 'author' ) ) {
echo 'Author';
} elseif ( user_can( $post->post_author, 'contributor' ) ) {
echo 'Contributor';
} elseif ( user_can( $post->post_author, 'subscriber' ) ) {
echo 'Subscriber';
} else {
echo 'Guest';
}

and some extra css and the result is here > null

Post count: 22421

Glad you got it going! Good job!
Thank you for sharing your code.

Post count: 14

🙂

Post count: 82

Hi Salyan this is actually nice can u please guide me too to how to do this

Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic.