siga
7/25/2015 - 9:06 AM

CSS and PHP to make the post date stand out

CSS and PHP to make the post date stand out

add_action( 'genesis_entry_header','sg_add_date', 5 );
function sg_add_date () {
if (is_home() || is_archive() || is_single()) { ?>
<div class="my-date">
<span class="my-date-day"><?php echo do_shortcode("[post_date format='j']"); ?></span>
<span class="my-date-month"><?php echo do_shortcode("[post_date format='M']"); ?></span>
<span class="my-date-year"><?php echo do_shortcode("[post_date format='Y']"); ?></span>
</div>
<?php }
}
	
//* Customize the post info function
add_filter( 'genesis_post_info', 'sp_post_info_filter' );
function sp_post_info_filter($post_info) {
if (is_home() || is_archive() || is_single()) {
$post_info = 'by [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}
}
.content article {position:relative;}

.my-date {
float: left;
display:block;
background-color: #0C4866;
padding: 5px;
color: #FFFFFF;
font-family: "Dosis", "Open Sans", arial, sans-serif;
font-size: 16px;
height: auto;
text-align: center;
text-transform: uppercase;
width: auto;
	margin:0 20px 0 0;
}
		   
span.my-date-day {color: #FFFFFF; font-size:40px; line-height:25px; background-color:#0EB7C9; display:block; width: 100%;padding:10px 0;}