Display year in post date
-
Excellent theme. Easy to manipulate. Thanks. Although I am trying to figure out how to have the year of a post displayed in the date.
http://www.hardestycapital.com/wordpress/
Anything you can do to help would be great.
Admin
Using a child theme, you can use the
graphene_post_dateaction hook to hook your own function to display the date, and then hide the default date using CSS.Admin
I think the easier way to this is this way:
1. Go to Graphene Display options page, and check Hide post date.
2. Using a child theme’s
functions.phpfile, create a function that will display the full post date including the year.3. Hook the above function to the
graphene_post_metaaction hook.4. Position the date using CSS.
The function to create in the
functions.phpand the hook should look something like this:function graphene_custom_post_date(){ ?>
<div class="custom_date"><?php the_time(get_option('date_format')); ?></div>
<?php
}
add_action('graphene_post_meta', 'graphene_custom_post_date');Don’t forget to position and style the custom date using CSS.
Simplier way :
In loop.php find
<p class="default_date"><?php the_time('M'); ?><br /><span><?php the_time('d') ?></span></p>And replace “M” by “Y” and “d” by “m”.
So, graphene will displays “year + month” instead of “Month + day”.
Thanks for the great theme.
Admin
Zampai,
The method you outlined is of course, easier, but is not recommended. This is because it involves editing the theme’s core files directly, which will cause you to lose the modification the next time you update the theme.
Viewing 8 posts - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.
