Support » Themes and Templates » Chocotheme – Adding Year to Date Displayed

  • Is it possible to add the year into the date displayed on Chocotheme for each post?

    I’ve spent hours trying to figure this out without any luck…

Viewing 3 replies - 1 through 3 (of 3 total)
  • You need to edit the template file(s) for the theme. It probably uses the_time() instead of the_date().

    Photog has a year on its dates on the left side of the posts. The code for this is very straightforward and might be easy to apply to ChocoTheme.

    I did the straightforward steps and wanted to share them with you:

    1. Find the following starting in the theme’s archive.php line 27, index.php line 8, search.php line 11 and single.php line 7:

    <span class=”day”><?php the_time(‘d’) ?></span>
    <span><?php the_time(‘M’) ?></span>

    and add this line right after them:

    <span class=”year”><?php the_time(‘Y’) ?></span>

    2. Find this in the theme’s style.css line 96:

    .post .date span { display: block; font-size: 16px; font-weight: bold; color: #f4b995; line-height: 1; text-transform: uppercase; }
    .post .date { font-size: 26px; }

    and add this line right after:

    .post .date span.year { font-size: 8px; }

    To change the size of the year, change the number in font-size. If you want to make the year much bigger than this, you may need to decrease the sizes on two lines above so they won’t hit the edges of the box.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Chocotheme – Adding Year to Date Displayed’ is closed to new replies.