[resolved] Post date on two seperate lines (8 posts)

  1. camilleaubrey
    Posted 2 years ago #

    Hi, I'm using a Twenty Ten child theme. I can't figure out how to style/code my entry-meta onto 2 separate lines. Right now, it reads: "Date: 10.24.12" on one line, and I would like it to read "Oct" on one line and "24" on the line below.

    How do I do this? Please help!

    This is my blog link.

  2. Marvel Labs
    Posted 2 years ago #

    You need to create different CSS and change the format your theme uses to display the date.

  3. alchymyth
    Forum Moderator
    Posted 2 years ago #

    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.

  4. camilleaubrey
    Posted 2 years ago #


    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 ]

  5. alchymyth
    Forum Moderator
    Posted 2 years ago #

    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

  6. camilleaubrey
    Posted 2 years ago #

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


  7. alchymyth
    Forum Moderator
    Posted 2 years ago #

    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:



  8. camilleaubrey
    Posted 2 years ago #

    Thanks! That worked beautifully.

Topic Closed

This topic has been closed to new replies.

About this Topic