• Resolved greenvespa

    (@greenvespa)


    Is it possible to show year on post date?
    I’m currently see only day and month but it’s not good for old post.
    Thanks

Viewing 1 replies (of 1 total)
  • Hello,
    Replace these lines :

    **** style.css *****

    .blog_post .date_of_post {
        position:relative;
    	left:1px;
    	width:54px;
        height:62px;
        color:#fff;
        float:left;
        margin:0;
    	background: #F15A23;
    }
    .blog_post .date_of_post .day_post {
        font-size:20px;
        text-align:center;
        filter:none;
        float:left;
        width:100%;
        font-weight:bold;
        margin:2px 0 0 0
    }
    .blog_post .date_of_post .month_post {
        font-size:12px;
        text-align:center;
        float:left;
        width:100%;
        text-transform:uppercase;
        line-height:18px;
    	position:relative;
    	top: -6px;
    }
    .blog_post .date_of_post .year_post {
        font-size:12px;
        text-align:center;
        filter:none;
        float:left;
        width:100%;
        font-weight:bold;
        line-height:10px;
    	position:relative;
    	top: -6px;
    }

    ***** content.php *****

    <article id="post-<?php the_ID(); ?>" <?php post_class('blog_post'); ?>>
    	<?php $day 			= get_the_date('d');
    		  $month_abr 	= get_the_date('M');
    		  $year_full	= get_the_date('Y');
    	?>
    	<?php if (get_the_title() == '') : ?>
    		<a href="<?php the_permalink(); ?>" rel="bookmark">
    	<?php endif; ?>	
    
    	<div class="date_of_post updated">
    		<span class="day_post"><?php print $day; ?></span>
    		<span class="month_post"><?php print $month_abr; ?></span>
    		<span class="year_post"><?php print $year_full; ?></span>
    	</div>

Viewing 1 replies (of 1 total)
  • The topic ‘date with year on post’ is closed to new replies.