WordPress.org

Forums

Entry-meta information (6 posts)

  1. camilledemondesir
    Member
    Posted 4 years ago #

    Hello,

    I'm trying to figure out how to edit my entry-meta data to only show the date. Right now it reads "Posted on {date} by {author}" and I would like it to only display a non-hyperlinked date.

    I'm using the Twenty Ten theme.

    Many thanks.

    http://parisinpink.com

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Don't edit the Twenty Ten theme. Your changes will be over-written the next time you upgrade WordPress. For this reason, it is recommended that you consider creating a child theme for your customisations. Once your child theme is active, we should be able to help with the customisation.

  3. camilledemondesir
    Member
    Posted 4 years ago #

    I'm aware of that, but I would still like to know where exactly in the code to make the changes I described...

  4. alchymyth
    Forum Moderator
    Posted 4 years ago #

    you can edit the function twentyten_posted_on() (from functions.php of the parent theme) and add the edited version to functions.php of the child theme.

  5. camilledemondesir
    Member
    Posted 4 years ago #

    Thanks! Which clause exactly do I delete so it only displays a non-hyperlinked date?

  6. alchymyth
    Forum Moderator
    Posted 4 years ago #

    for example, leave just this:

    function twentyten_posted_on() {
    	printf( __( '<span class="%1$s">Posted on</span> %2$s', 'twentyten' ),
    		'meta-prep meta-prep-author',
    		sprintf( '<span class="entry-date">%1$s</span>',
    			get_the_date()
    		)
    	);
    }

    (untested)

Topic Closed

This topic has been closed to new replies.

About this Topic