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 am using this filter to display guest author on post, but i want guest author's posts to appear in the author.php template also.

This is my guest author code (inside functions.php).

<?php
add_filter( 'the_author', 'guest_author_name' );
add_filter( 'get_the_author_display_name', 'guest_author_name' );
function guest_author_name( $name ) {
    global $post;

    $author = get_post_meta( $post->ID, 'guest-author', true );

    if ( $author )
        $name = $author;
    return $name;
}
?>

...and here is the author template: http://codex.wordpress.org/Author_Templates#Sample_Template_File

share|improve this question
    
if you make a subscriber level user and assign the post to that user should be able to load his posts on author.php template.. –  Sisir Oct 28 '11 at 11:14
    
@Otto Please do a full edit, when editing a post. Edits are "expensive", which means, the question is transformed to a "community wiki" after too many edits. Thanks. –  kaiser Aug 31 '12 at 0:52
    
@user8503/OP Please make use of the WYSIWYG editor when asking or answering. And please use upper-/lowercase characters. At least this isn't chat. –  kaiser Aug 31 '12 at 0:52

1 Answer 1

Create a new user with a role such as subscriber so they cant do anything in the backend, and assign the post to that user. Doing this would be a lot easier than the hours of custom coding needed to get things working using your system.

share|improve this answer

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.