Support » Themes and Templates » [Resolved] Post date on two seperate lines

[Resolved] Post date on two seperate lines

Viewing 7 replies - 1 through 7 (of 7 total)
  • You need to create different CSS and change the format your theme uses to display the date.

    Moderator Michael


    Forum Moderator

    you need to edit the function twentyten_posted_on()
    in functions.php of Twenty Ten;

    which you seem to have done already;

    break the single get_the_date() into get_the_date('M') and get_the_date('d') or get_the_date('j')

    for details, please post the code as you have it now.


    So I managed to change the date format but still can’t “Oct” and “24” on 2 separate lines. Here is my functions.php code. Any ideas on how to do this??

    [code moderated – the posted code was corrupted;
    please use the pastebin for large amounts of code – http://codex.wordpress.org/Forum_Welcome#Posting_Code ]

    Moderator Michael


    Forum Moderator

    your posted code was corrupted by getting posted without being marked with the code buttons;
    also it is recommended to use the http://pastebin.com/ for larger amounts of code.

    please repost the code – http://codex.wordpress.org/Forum_Welcome#Posting_Code

    My apologies! Here is the URL for the code in pastebin. Hopefully that works.


    Moderator Michael


    Forum Moderator

    example (relevant section only; unnecessary code removed):

    function twentyten_posted_on() {
    	printf( __( '<span class="%1$s"></span> %2$s ', 'twentyten' ),
    		'meta-prep meta-prep-author',
    		sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"></a><span class="entry-date">%3$s<br />%4$s</span>',
    			esc_attr( get_the_time() ),
    			'<span class="entry-date-month">'.get_the_date('M').'</span>',
    			'<span class="entry-date-day">'.get_the_date('d').'</span>'

    as you can see, in this section, the date is output in two bits, separated by a linebreak:

    <span class="entry-date">%3$s<br />%4$s</span>

    and the two bits are generated here:

    '<span class="entry-date-month">'.get_the_date('M').'</span>',
    '<span class="entry-date-day">'.get_the_date('d').'</span>'

    these two lines was just this before:



    Thanks! That worked beautifully.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Post date on two seperate lines’ is closed to new replies.