[theme: twentytwelve] Help with date coding and styling
-
Hello,
I’m trying to figure out how to get the date to show up to the left of the post title, styled a certain way. I got this to work on a genesis theme, but I’m new to twentytwelve and can’t quite seem to sort it out.
Here’s the code in a genesis (prose) theme that worked nicely before:
add_action( 'genesis_before_post_title', 'child_before_post_title' ); function child_before_post_title() { if ( ! is_page() ) { ?> <div class="entry-meta"> <span class='day'><?php the_time('j');?></span> <span class='month'><br/><?php the_time('M'); ?></span> </div> <?php } }
That, with some CSS of course, resulted in this: https://elevensixty.com/date-comment.png (minus the comment stuff which I did elsewhere). The code also made sure the date only showed on post pages, not static pages where it wasn’t needed.
In twentytwelve, I am trying to accomplish something similar. Here is a screen capture from the PSD file to show you what I’m aiming for: https://elevensixty.com/date.png
I believe I need help with the action part, I’m not sure what the right code is.
Thank you!
- The topic ‘[theme: twentytwelve] Help with date coding and styling’ is closed to new replies.