Support » Plugins » How to display Day of Week with get_the_date?

  • Resolved deko


    I’m trying to modify a function in the Twenty Ten 1.3 theme. Below is the function (from lines 489 and following of /themes/twentyten/functions.php).

    What I’m trying to do is change esc_attr( get_the_time() ) so it returns the day of week (e.g. Wednesday).

    I can substitute get_the_date() for get_the_time() but how, in this context, do I apply the necessary filter to get the day of week? Everything I’ve tried just broke the function. Is it a matter of syntax or do I have to rework the 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>',
    			esc_attr( get_the_time() ),
    		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() ) ),
Viewing 1 replies (of 1 total)
  • ugh. it may not look like it, but there’s a lot of difference between 1 and l

    solution: esc_attr( get_the_date('l') )

Viewing 1 replies (of 1 total)
  • The topic ‘How to display Day of Week with get_the_date?’ is closed to new replies.