Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have one multi-authored blog site and a few editors.

What I want is to display the name of the editor along with the author's name in a post, so that it would read like: Posted by , Edited by

Is it possible?

share|improve this question
    
Can you post the sample code, working or not, that you tried already? Do that is a good practice in this site to make your question avoid "Do-the-job-for-me" format. –  cybmeta May 11 at 9:51

2 Answers 2

up vote 2 down vote accepted

Here's a small screenshot of what this code produces:

enter image description here

Demo Editor is a new user i added with Editor status and then logged in as Demo Editor and modified a post to test this solution works.

You can create a custom template tag in your child theme like this and add the template tag in your content.php file.

All depends on your theme.

Tested and works on Twenty Fourteen:

Here's the template tag example you can add to a file named template-tags.php in your child theme:

<?php if ( ! function_exists( 'edited_by' ) ) :

function edited_by() { 

printf( '<span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>',
    esc_url( get_permalink() ),
    esc_attr( get_the_date( 'c' ) ),
    esc_html( get_the_date() ),
    esc_url( get_author_posts_url( get_the_author_meta( 'editor' ) ) ),
    get_the_modified_author()
);
}
endif;

The above code needs some work however it does work on the front end.

The editor author link will need to be fixed and you will need to add the text Edited by:

Below is an example of how it looks in the content.php file i copied over to the child theme.

<div class="entry-meta">
<?php
if ( 'post' == get_post_type() )
twentyfourteen_posted_on();
edited_by(); ?>

I also added this in functions below to include the new file.

// Custom template tags for this theme.
require get_stylesheet_directory() . '/inc/template-tags.php';
share|improve this answer
    
Brilliant! Thanks :) –  Sam DG May 11 at 15:03

Try the_modified_author() or get_the_modified_author(), this should give you the display name of the last user that modified the post.

From: other post

share|improve this answer
    
Thanks for this @pascalvgemert, i included it in my answer. –  Brad Dalton May 11 at 10:30
    
Nice, don't forgot to vote up for me ;) –  pascalvgemert May 11 at 12:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.