• Hey guys,

    I was wondering how I could change the default date format in articles from “month.day.year” to “day.month.year” ? I guess its in the functions.php but where exactly ?
    I m using a twenty-eleven child theme.
    Any help would be appreciated,

    vince

Viewing 3 replies - 1 through 3 (of 3 total)
  • The relevant function is in functions,php:

    function twentyeleven_posted_on() {
    	printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ),
    		esc_url( get_permalink() ),
    		esc_attr( get_the_time() ),
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_date() ),
    		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    		esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),
    		get_the_author()
    	);
    }

    In your child theme’s version of this function, you would need to add the relevant parameters to get_the_date(). See Formatting_Date_and_Time.

    set the time display from within:

    dashboard – settings – general – date format

    Thread Starter vince23

    (@vince23)

    Thanks for the quick response guys, thats what I was lookin for !

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Date format in articles’ is closed to new replies.