Support » Fixing WordPress » How to remove posted date and by…

  • Resolved moserengineering

    (@moserengineering)


    How do I remove the following things from the TwentyTen template?

    Posted on July 19, 2010 by admin

    Posted in Uncategorized | Comments Off

    Thank you.

Viewing 15 replies - 1 through 15 (of 28 total)
  • I would like to remove the date and author of the post and also the posted in uncategorized/comments off. Thanks.

    moserengineering,

    Open the functions.php file and look for the following code. Just comment it out in case you want it later by using /* and */.

    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;

    Thanks, that worked to get rid of the date and author.

    Now, how about getting rid of the Posted in Uncategorized | Comments Off part?

    below this function you will see twentyten_posted_in() function. Edit this for Posted in Uncategorized | Comments Off part.

    I found this and deleted it but it didn’t seem to do anything? Is this the right thing?

    if ( ! function_exists( ‘twentyten_posted_in’ ) ) :
    /**
    * Prints HTML with meta information for the current post (category, tags and permalink).
    *
    * @since Twenty Ten 1.0
    */
    function twentyten_posted_in() {
    // Retrieves tag list of current post, separated by commas.
    $tag_list = get_the_tag_list( ”, ‘, ‘ );
    if ( $tag_list ) {
    $posted_in = __( ‘This entry was posted in %1$s and tagged %2$s. Bookmark the permalink.’, ‘twentyten’ );
    } elseif ( is_object_in_taxonomy( get_post_type(), ‘category’ ) ) {
    $posted_in = __( ‘This entry was posted in %1$s. Bookmark the permalink.’, ‘twentyten’ );
    } else {
    $posted_in = __( ‘Bookmark the permalink.’, ‘twentyten’ );
    }
    // Prints the string, replacing the placeholders.
    printf(
    $posted_in,
    get_the_category_list( ‘, ‘ ),
    $tag_list,
    get_permalink(),
    the_title_attribute( ‘echo=0’ )
    );
    }
    endif;

    yes.

    can someone post the original code for the functions php for the twentyten template. I think I need to get back to the original and try this again. Thanks.

    http://wordpress.org/download/

    just DL a fresh copy to your computer and grab the code

    I uploaded the original file (thanks Rev. Voodoo) and now when I follow post 3 and delete the information my page says Fatal error: Call to undefined function twentyten_posted_on() in /home2/jmoseren/public_html/wp-content/themes/twentyten/loop.php on line 128.

    Any ideas? Thanks.

    remove / or commenting the function twentyten_posted_on() and twentyten_posted_in() in loop.php

    I found twentyten_posted_on() in the loop file in a couple spots and I tried deleting some stuff but it didn’t work. What parts from below am I supposed to delete? Thanks.

    <?php /* How to display posts in the asides category */ ?>

    <?php elseif ( in_category( _x(‘asides’, ‘asides category slug’, ‘twentyten’) ) ) : ?>
    <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>

    <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
    <div class=”entry-summary”>
    <?php the_excerpt(); ?>
    </div><!– .entry-summary –>
    <?php else : ?>
    <div class=”entry-content”>
    <?php the_content( __( ‘Continue reading <span class=”meta-nav”>→</span>’, ‘twentyten’ ) ); ?>
    </div><!– .entry-content –>
    <?php endif; ?>

    <div class=”entry-utility”>
    <?php twentyten_posted_on(); ?>
    <span class=”meta-sep”>|</span>
    <span class=”comments-link”><?php comments_popup_link( __( ‘Leave a comment’, ‘twentyten’ ), __( ‘1 Comment’, ‘twentyten’ ), __( ‘% Comments’, ‘twentyten’ ) ); ?></span>
    <?php edit_post_link( __( ‘Edit’, ‘twentyten’ ), ‘<span class=”meta-sep”>|</span> <span class=”edit-link”>’, ‘</span>’ ); ?>
    </div><!– .entry-utility –>
    </div><!– #post-## –>

    <?php /* How to display all other posts. */ ?>

    <?php else : ?>
    <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
    <h2 class=”entry-title”>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), the_title_attribute( ‘echo=0’ ) ); ?>” rel=”bookmark”><?php the_title(); ?></h2>

    <div class=”entry-meta”>
    <?php twentyten_posted_on(); ?>
    </div><!– .entry-meta –>

    <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
    <div class=”entry-summary”>
    <?php the_excerpt(); ?>
    </div><!– .entry-summary –>
    <?php else : ?>
    <div class=”entry-content”>
    <?php the_content( __( ‘Continue reading <span class=”meta-nav”>→</span>’, ‘twentyten’ ) ); ?>
    <?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link”>’ . __( ‘Pages:’, ‘twentyten’ ), ‘after’ => ‘</div>’ ) ); ?>
    </div><!– .entry-content –>
    <?php endif; ?>

    <div class=”entry-utility”>
    <?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; ?>
    <?php
    $tags_list = get_the_tag_list( ”, ‘, ‘ );
    if ( $tags_list ):
    ?>
    <span class=”tag-links”>
    <?php printf( __( ‘<span class=”%1$s”>Tagged</span> %2$s’, ‘twentyten’ ), ‘entry-utility-prep entry-utility-prep-tag-links’, $tags_list ); ?>
    </span>
    <span class=”meta-sep”>|</span>
    <?php endif; ?>
    <span class=”comments-link”><?php comments_popup_link( __( ‘Leave a comment’, ‘twentyten’ ), __( ‘1 Comment’, ‘twentyten’ ), __( ‘% Comments’, ‘twentyten’ ) ); ?></span>
    <?php edit_post_link( __( ‘Edit’, ‘twentyten’ ), ‘<span class=”meta-sep”>|</span> <span class=”edit-link”>’, ‘</span>’ ); ?>
    </div><!– .entry-utility –>
    </div><!– #post-## –>

    <?php comments_template( ”, true ); ?>

    <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>

    Post long code in http://pastebin.com/ so its easier to read and no markup mistakes from the forum.

    <?php twentyten_posted_on(); ?>

    just this bit I would think? Could just be commented out like this:

    <!-- <?php twentyten_posted_on(); ?> -->

    I think its in there twice

    thank you, that worked.

    Sure thing!

Viewing 15 replies - 1 through 15 (of 28 total)
  • The topic ‘How to remove posted date and by…’ is closed to new replies.