WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Defalut author name to be changed (3 posts)

  1. drashokshyam
    Member
    Posted 1 year ago #

    Hi,
    as admin of my site i wish to add articles by other authors. However wordpress always identifies me [admin] as the defalut author. I have tried the co-author plugin still the admin is defalut author in the metadata.

    site is http://www.jocr.co.in/wp/

    can i change the default author and put custom authors name [also i wanted to do this without registering them to my site if needed]

    Please suggest

    Thanks

    ashok shyam

  2. Jay Hoffmann
    Member
    Posted 1 year ago #

    You absolutely can! Make sure that you are running an up to date version of WordPress, then go to Users -> Add New in your admin panel and add any new users you want to use as authors.

    Then, edit one of your posts. In the top right hand corner select the "Screen Options" button. This will pulldown a menu. Make sure that the "Author" checkbox is checked. Underneath your WYSIWYG Editor will appear a panel called "Author" where you can select the authors name.

    Unfortunately, you will have to register these authors. If you want to put a custom authors name you will have to add a function to your functions.php file that looks like this:

    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;
    }

    Then in your custom fields panel, enter "guest-author" as your key and the name of your author as your value. This will overwrite the current author name.
    Source: http://www.wpbeginner.com/wp-tutorials/how-to-rewrite-guest-author-name-with-custom-fields-in-wordpress/

  3. drashokshyam
    Member
    Posted 1 year ago #

    Thanks Jhoffm for prompt reply.

    I used the method you detailed and i could
    My issue is that when i inspect elements the admin remains the defalut author of the post.

    any way to change this?

Topic Closed

This topic has been closed to new replies.

About this Topic