• I’m hoping to reproduce the date formatting like this page:

    http://www.tastingmenu.com/

    The problem is you have to put different CSS styles on each element of the date. How can you do that?

    You can’t put for instance a br tag in the format string because php interprets it. You can’t put multiple the_date() calls because only the first will show up.

    Ideas?

Viewing 5 replies - 1 through 5 (of 5 total)
  • One way is to place the time call 3 times and give each one a class such as time1 time2 etc… you can then style away to your hearts content 🙂

    you may not be able to call the_date multi times, but the_time(‘insert format here’) does work.

    Tg

    Mycroft,
    If you figure that one out, let me know! I love that layout. (something else to work on during sleepless nights…)

    Omar

    I’ve tried it on my site just for something to do – and it seems to work – not sure if I will keep it mind you – but it does appear to work…

    Thread Starter mycroft007

    (@mycroft007)

    I got it working on my site. The Tasting Menu site uses tables for layout and I used CSS. Which means if my post is shorter than the date block is pushes over the next entry.

    I also made the time big instead of the day of the month.

    Here’s what the index.php code looks like.


    <div class="meta">
    <div class="dateSquare">
    <div class="date-big">
    <?php the_time() ?>
    <br/>
    </div>
    <div class="date">
    <?php the_time('l'); /* day of the week */?> <br/>
    <?php the_time('F'); /* full month of the year */?> <br/>
    <?php the_time('d'); /* day of the month */?> <br/>
    <?php the_time('Y'); /* Year */?><br/>
    <hr/>
    <?php the_category() ?>
    <!--?php the_author() ?-->
    </div>
    </div>

    I may do a little editing in the near future to change the format a little.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘CSS in date’ is closed to new replies.