• Resolved stevedw

    (@stevedw)


    How do i make it so the date and author name isn’t shown above each post? Also, how do i remove the bit below each post which shows what category the post is in?

    Im using the Twenty Ten theme.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You need to amend the twentyten_posted_on() function in functions.php and remove:

    <?php if ( count( get_the_category() ) ) : ?>
    					<span class="cat-links">
    						<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
    					</span>
    					<span class="meta-sep">|</span>
    				<?php endif; ?>

    from loop.php. But be warned that your customisations will be over-written the next time you upgrade WordPress or the theme. For this reason, it is recommended that you consider creating a child theme for your customisations.

    Thread Starter stevedw

    (@stevedw)

    Thanks. What do i amend the twentyten_posted_on() function to exactly in functions.php

    Thread Starter stevedw

    (@stevedw)

    Ive removed the bit which displays what category a post is in but im having a problem removing the date and author part.

    I removed the section of the code in functions.php but it messed it up completely, when i viewed the site it just displayed an error. Fortunatly i had a copy of functions.php so uploaded the original again.

    What do i have to edit exactly in functions.php to remove the date/author part?

    Thread Starter stevedw

    (@stevedw)

    I still haven’t resolved this. Can someone please help.

    You need to change:

    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;

    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() {
    }
    endif;

    But remember that, ideally, this should be part of a child theme’s functions.php file – in which case, you would just use:

    function twentyten_posted_on() {
    }
    Thread Starter stevedw

    (@stevedw)

    Thanks. It worked well.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Removing date and author’ is closed to new replies.