WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Show current date (9 posts)

  1. Corse
    Member
    Posted 5 years ago #

    Hello,

    I want to add the current date in my right navbar. I know how to use the echo date function. But i only can use the the_time function, becouse it need to be into dutch date format.

    When i place <?php the_time('j F Y'); ?> it only shows the last post date.

    What do it need to do to make in show the current date?

    Please help.

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    <?php echo date('j F Y'); ?>

  3. Corse
    Member
    Posted 5 years ago #

    The <?php echo date('j F Y'); ?> function shows the date in English format. The the_time function shows it on my website in Dutch. So i need to use the the_time function. But how to make it show the current date.

    http://www.alfablog.nl

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    OH! Okay. Missed that bit.

    <?php echo date_i18n('j F Y', time()); ?>

  5. Corse
    Member
    Posted 5 years ago #

    Yes it works..

    Thank you!

  6. ashzul
    Member
    Posted 5 years ago #

    I want to show my current date in Malay, what function should i use?

  7. flatsilver
    Member
    Posted 5 years ago #

    once i add the code, how do i move it / style it to where i need it to be? and i need the letters white instead of black.
    thank you

  8. pioneerka
    Member
    Posted 5 years ago #

    I want to show my current date in Malay, what function should i use?

    the same one
    <?php echo date_i18n('j F Y', time()); ?>
    it displays date in your wp's language

  9. pioneerka
    Member
    Posted 5 years ago #

    how do i move it / style it to where i need it to be?

    you should use somethimg like this:
    <span class="current-date"><?php echo date_i18n('j F Y', time()); ?></span>
    now you can play with your style.css. just add the following lines:
    .current-date {
          color: #fff;
    }

    it should work.

Topic Closed

This topic has been closed to new replies.

About this Topic