Support » Themes and Templates » Styling entry_date

Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael


    Forum Moderator

    how do you want the rest of the ‘posted on’ line to look like?

    the code changes will depend on the total layout of that line.

    I am deleting or use display:none for the rest of the line. I only want to keep the date for now.
    well, I found this code to add to the get_the_date, and style each part somehow.

    get_the_date(‘<\s\p\a\n \c\l\a\s\s=”\m\o\n\t\h”>M</\s\p\a\n><\b\r /><\s\p\a\n \c\l\a\s\s=”\d\a\t\e”>j</\s\p\a\n><\b\r /><\s\p\a\n \c\l\a\s\s=”\y\e\a\r”>Y</\s\p\a\n>’)
    It seems a bit messy but it works. Is there a better and professional way to do this?
    I am also open to codes which keep the rest of posted on line, cause you never know if you change your mind again.

    Thanks a lot!



    Forum Moderator

    this would also work:

    function twentyten_posted_on() {
    	printf( __( '<span class="%1$s">Posted </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%4$s%5$s</span></a>',
    			esc_attr( get_the_time() ),
    			'<span class="date-month">'.get_the_date('M').'</span>',
            	'<span class="date-day">'.get_the_date('d').'</span>',
            	'<span class="date-year">'.get_the_date('Y').'</span>'

    and this would ‘hide’ the ‘Posted by author’:
    .meta-prep, .entry-meta .author, .entry-meta .meta-sep { display:none; }

    Thank you so much 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Styling entry_date’ is closed to new replies.