WordPress.org

Support

Support » Themes and Templates » [Resolved] align today's date on right margin

[Resolved] align today's date on right margin

Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael

    @alchymyth

    the_time() does show the publish time of a post;
    outside the loop, this could be random, possibly the last or first post on the page.

    http://codex.wordpress.org/Function_Reference/the_time

    consider to use date() instead; http://php.net/manual/en/function.date.php

    as for the formatting, you are confusing css ids and classes;
    http://www.w3schools.com/css/

    befree22

    @befree22

    OK, I used this code for the date: <?php echo date('l jS, F, Y') ?>

    For the css, I added this code but the date isn’t aligning to the right of the blog page:
    `.todaysdate {
    float: right;
    color: #444;
    font-size: 20px;
    line-height: 1.625em;
    padding: 0 1.2125em;
    margin-top: 10px;
    font-weight: bold;
    }`

    It works when I use .todaysdate but not when I use #todaysdate. Thanks 🙂

    I’m using a 2012 child theme on the site.

    WPyogi

    @wpyogi

    Forum Moderator

    You need to use .todaysdate (period for class, hashtags are for id)

    befree22

    @befree22

    It works! Now I know the difference between period for class, hashtags are for id.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] align today's date on right margin’ is closed to new replies.
Skip to toolbar