WordPress.org

Ready to get started?Download WordPress

Forums

Can you pls help me with the the piece of codes (5 posts)

  1. xutianwei
    Member
    Posted 2 years ago #

    Hi, can any one pls help me out. I modify a theme which contains this code:`
    <?php unset($previousday); printf( __( '%1$s – %2$s', 'sandbox' ), the_date( 'M j', '', '', false ),get_the_time() ) ?>`

    But the output format is like both Month name and date and time. Can any just help so that I can only get the month name and date? That's I don't want the time. Like, today is May 3rd, I just want format like this. Thank you very much

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Try searching the Codex. It's faster than asking here.
    http://codex.wordpress.org/Function_Reference/the_date

  3. xutianwei
    Member
    Posted 2 years ago #

    Hi, thanks for your link. But I'm really a noob with the code things. Can you help me just change the code?

    Thank you very much.

  4. xutianwei
    Member
    Posted 2 years ago #

    Another thing I need help is that if I deleted the ",,get_the_time()" for the codes, it doesn't work and give out warning. I only need the date but not the time, how can I do that?

  5. alchymyth
    Forum Moderator
    Posted 2 years ago #

    try:

    <?php unset($previousday); printf( __( '%1$s', 'sandbox' ), the_date( 'M j', '', '', false ) ) ?>

    http://php.net/manual/en/function.printf.php

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags