Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8147247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:17:19+00:00 2026-06-06T14:17:19+00:00

I wanted wrapping month, day, and year separately inside divs and I tried doing

  • 0

I wanted wrapping month, day, and year separately inside divs and
I tried doing this

function posted_on_main_page() {
    $format= '<div class="posted-date">
                  <div class="posted-month">%1$s</div>
                  <div class="posted-day">%2$s</div>
                  <div class="posted-year">%3$s</div>
              </div>';
    $month = the_time('M');
    $date = the_time('j');
    $year = the_time('Y');
    printf($format, $month, $date, $year);

}

but for some reasons when I inspect element it displays date before everything

Jun272012<div class="posted-date">
              <div class="posted-month"></div>
              <div class="posted-day"></div>
              <div class="posted-year"></div>
         </div> 

If you have another solution to wrap date separately pls help me out.

Thnx in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:17:20+00:00Added an answer on June 6, 2026 at 2:17 pm

    Rather than calling the_time($format), use get_the_time($format). This returns the value, rather than echoing it immediately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Wanted an easy way to extract year month and day from a string. Using
I have a div box (called flux) with a variable amount of content inside.
Wanted to create a fun app with photo. This is the scenario: I have
wanted a solution on how to access the javascript variable inside the java scope.
Wanted for property grid, in the PropertyType function of the class derived from PropertyDescriptor,
I wanted to post an image to describe this problem, but apparently I don't
I'm a newcomer to clojure who wanted to see what all the fuss is
I wish to source a script, print the value of a variable this script
Wanted to add an alias for one of the charsets that PayPal may use
Wanted to try something new, using the awesome twitter bootstrap and their Less CSS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.