Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How do I remove?

  • "Author Archives: Merms", on http://shs.merms.info/author/Merms.
  • "by Merms", but keep "Posted on December 30, 2010" on all pages
  • Posted in Article, Awards, Employer News, Events, Resources, Uncategorized and keep "Comments" on all pages.

Using twenty twenty ten modified. Not using sidebar widget.

share|improve this question
search for these strings in the template files, then create a child theme in which you copy these files and remove the strings... – One Trick Pony Jan 3 '11 at 18:29

1 Answer

In functions.php find:

 if ( ! function_exists( 'twentyten_posted_on' ) ) :
/**
 * Prints HTML with meta information for the current post—date/time and author.
 *
 * @since Twenty Ten 1.0
 */
function twentyten_posted_on() {
    printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),
        'meta-prep meta-prep-author',
        sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
            get_permalink(),
            esc_attr( get_the_time() ),
            get_the_date()
            ),
        sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
            get_author_posts_url( get_the_author_meta( 'ID' ) ),
            sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ),
            get_the_author()
        )
    );
}
endif;

Change to:

if ( ! function_exists( 'twentyten_posted_on' ) ) :
/**
 * Prints HTML with meta information for the current post—date/time and author.
 *
 * @since Twenty Ten 1.0
 */
function twentyten_posted_on() {
    printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),
        'meta-prep meta-prep-author',
        sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
            get_permalink(),
            esc_attr( get_the_time() ),
            get_the_date()
        ),

    );
}
endif;

In other words you're just removing the bit of code that reads:

sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
                get_author_posts_url( get_the_author_meta( 'ID' ) ),
                sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ),
                get_the_author()
            )
share|improve this answer
That's for the author, just noticed the second part of your question. Right below the above function is the twentyten_posted_in() function. just go to the single.php file and remove the call to the twentyten_posted_in() function to remove the posted in section. The call is towards the bottom of the file. – Adam Thompson Jan 3 '11 at 22:52
Hi Adam - Thank you for your help. Let me know if I can help you with anything. Everything ended up working out and I was able to keep the authors, which at first was causing layout issues that was why I wanted to remove it. Dave – user2266 Jan 5 '11 at 15:39
Hi Im afraid I got an error message when I did this, luckily had saved a copy of functions.php before I did it. – user3587 Feb 28 '11 at 23:27

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.