WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to remove author from posts? (8 posts)

  1. Hilas
    Member
    Posted 2 years ago #

    here is my post:
    http://bigsport.lt/?p=202
    how to remove author?

  2. rfair404
    Member
    Posted 2 years ago #

    All content that is written in WP stores the author information. You can remove the author, but it would be a pain. If you just don't want it to show up to users on the front end website, then edit your template file and remove the author link or use css to hide it from view using display:none.

  3. WP Sites - Brad Dalton
    Member
    Posted 2 years ago #

    You'll need to edit your files and find the php code for your author link.

    Create a backup of any files you want to edit first

  4. Hilas
    Member
    Posted 2 years ago #

    in author-template.php i found:

    * Display the name of the author of the current post.

    function the_author( $deprecated = '', $deprecated_echo = true ) {
    	if ( !empty( $deprecated ) )
    		_deprecated_argument( __FUNCTION__, '2.1' );
    	if ( $deprecated_echo !== true )
    		_deprecated_argument( __FUNCTION__, '1.5', __('Use <code>get_the_author()</code> instead if you do not want the value echoed.') );
    	if ( $deprecated_echo )
    		echo get_the_author();
    	return get_the_author();

    i need to change something here? or i'm looking in wrong place?

  5. rfair404
    Member
    Posted 2 years ago #

    no don't change anything in the core WordPress files unless you know what you're doing. Somewhere in your theme files (yoursite.com/wp-content/themes/your-theme) you will find several files that have something that looks like <?php the_author_link(); ?> that is what you need to remove.

  6. Hilas
    Member
    Posted 2 years ago #

    author.php

    <?php if(isset($_GET['author_name'])) : $curauth = get_user_by('slug', $author_name); else : $curauth = get_userdata(intval($author)); endif; ?>
        <div id="author-page">
        	<?php echo get_avatar($curauth->user_email, '90', $avatar); ?>
            <h1>About <?php echo $curauth->nickname; ?></h1>
        	<?php echo $curauth->user_description; ?>
            </div><!-- author-page -->
    <h2 id="author-page-posts-title">Articles Published by <?php echo $curauth->nickname; ?></h2>

    maybe here i need to change something?

  7. rfair404
    Member
    Posted 2 years ago #

    I guess the question is - wtf do you mean by "how to remove author?" in your initial post? Do you want their name to go away?

    If so look at the post above and open single.php, archive.php and index.php and remove the <?php the_author_link(); ?>

  8. Hilas
    Member
    Posted 2 years ago #

    thanks a lot. problem resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic