WordPress.org

Ready to get started?Download WordPress

Forums

Serene
Date Format (4 posts)

  1. Wilson Hobbs
    Member
    Posted 9 months ago #

    Does anyone know how to make the date format at the bottom have the year in the date?

    Thanks,
    Wilson

  2. thatiphoneblog
    Member
    Posted 8 months ago #

    On top of that, does anybody know how to remove the date completely? (Or alternatively, order posts in whichever order we want?)

    Thanks,
    Jamie

  3. Christopher Anderton
    Member
    Posted 8 months ago #

    Line 622 to 637 in functions.php is where you find the Date function.

    To modify the output of the date, find this code (line 628):

    get_the_time( _x( 'M', 'post info month name', 'Serene' ) ),
    				get_the_time( _x( 'd', 'post info day', 'Serene' ) ),

    The first line here outputs the Month ('M'). The second the day ('d') as you can see.
    Let's say we want to output the year, month and day together. Example: 2013-10-18

    Replace the code above with:

    get_the_time( _x( 'Y-m-d', 'post info date name', 'Serene' ) ),

    Just above this code, on line 627, we will find this:

    printf( '<span class="meta-post-date"><strong>%s.</strong>%s</span> <a href="%s"><div class="meta-comments-count"><span aria-hidden="true" class="icon_comment_alt"></span>%s</div></a>',

    Replace that with:

    printf( '<span class="meta-post-date"><strong>%s</strong></span> <a href="%s"><div class="meta-comments-count"><span aria-hidden="true" class="icon_comment_alt"></span>%s</div></a>',

    You may want to modify the CSS of the date output to make it fit/look better in the box.

    In style.css line 299 to 305 find this:

    .meta-date-wrap {
    	width: 165px;
    	height: 55px;
    	display: inline-block;
    	position: relative;
    	-webkit-perspective: 600px;
    }

    Change to something like this:

    .meta-date-wrap {
    	width: 15%;
    	height: 55px;
    	display: inline-block;
    	position: relative;
    	-webkit-perspective: 600px;
    }

    Here is a Pastebin link with everything wrapped up (just the functions.php part):
    http://pastebin.com/P1CTGkL5

    To use your own formatting of the date, see the codex: http://codex.wordpress.org/Formatting_Date_and_Time

    Also. Best practice, and also more convenient is to use a child theme for modifications. But that is a different topic. More about this here: http://codex.wordpress.org/Child_Themes
    Good luck!
    / Christopher

  4. squarm
    Member
    Posted 5 months ago #

    @ Christopher Anderton: Thank you so much - worked great for me!

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.