WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Ten
[resolved] Customize "twentyten_posted_on" function for Date (8 posts)

  1. IceyD
    Member
    Posted 2 years ago #

    Hi everyone!

    I'm trying to customize my first WordPress.org blog, and I've got a lot of things under control. In Blogger, I found a way to customize the position of the date, as well as add styling to each element of the date - the day, month, and year.

    I have no idea how to do that in the Twentyten theme though. Any help?
    Do I have to adjust the coding in function.php? Or just in loop.php?

    Here's the 'twentyten_posted_on' function:

    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' ) ),
    
    			esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ),
    
    			get_the_author()
    
    		)
    
    	);

    Thank you for any help!

    http://wordpress.org/extend/themes/twentyten/

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

  3. IceyD
    Member
    Posted 2 years ago #

    I tried that.. but when I reload the page, it says there's a server error. Am I just supposed to replace:

    get_the_date()

    with:

    '<time class="month">' . get_the_date('F') . '</time><time class="day">' . get_the_date('d') . '</time><time class="year">' get_the_date('Y') . '</time>'

    Sorry, I don't know much when it comes to php and scripting.

    Thanks!

  4. IceyD
    Member
    Posted 2 years ago #

  5. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    Am I just supposed to replace: get_the_date() with: ...

    yes

    get that server error:

    what error exactly?

    can you post the full error message?

  6. IceyD
    Member
    Posted 2 years ago #

    This is it:

    500 - Internal Server Error

  7. IceyD
    Member
    Posted 2 years ago #

    Do you know what I should do, Alchymyth?
    I'm going insane trying to figure this out.

    Thanks

  8. IceyD
    Member
    Posted 2 years ago #

    Alchymyth,

    I figured it out. The code I took from the post you gave me? It was missing a period. All fixed now!

    Thanks for your help.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic