WordPress.org

Ready to get started?Download WordPress

Forums

Frau
Add time&year in the entries (10 posts)

  1. xoxoNicole
    Member
    Posted 8 months ago #

    Hi!

    I'm totally new to WordPress, it's great, love it so far :)

    I need some help. I jsut want to know how to add the date and time at the bottom of my entries or maybe in the tab that sticks out from each post, where the day is located. There is not time and year there.

    Can you help me and take a look at my site how to do?

    Thnx'
    http://xoxonicole.com

  2. LizardThemes
    Member
    Theme Author

    Posted 8 months ago #

    Hi!
    Could you clarify your issue? As I can see there is the date of publication of the post on the top left of each post you have. Why do you need to specify the date at the bottom of your post again?

  3. xoxoNicole
    Member
    Posted 8 months ago #

    I mean the time, not the date. I would want the time to show.

  4. LizardThemes
    Member
    Theme Author

    Posted 8 months ago #

    To fix this you have to replace the code:
    <div class="post-date"><?php echo get_the_date('d'); ?><div class="post-day"><?php echo get_the_date('M');?></div></div>
    with:
    <div class="post-date"><?php echo get_the_date('d'); ?><div class="post-day"><?php echo get_the_date('M');?><div class="post-time"><?php the_time('g:i a');?></div></div></div>
    in the file content.php.
    Besides, you have to increase height for the element .post-date in the file style.css.

  5. xoxoNicole
    Member
    Posted 8 months ago #

    Thanks alot, it helped so much!

    Just one more thing. I live in Sweden, so I want the time to be as "stockholm", I looked on the web and it should be time zone CET, but i can't get the hang of it, how to write it in the file.

    e('h:i, CET');

    Gets wrong on the website.

    http://www.timeanddate.com/library/abbreviations/timezones/eu/

  6. xoxoNicole
    Member
    Posted 7 months ago #

    I fixed it :) Ty

  7. xoxoNicole
    Member
    Posted 6 months ago #

    I would now like to add the year in my blog posts, it's confusing when you only can read out the date..and not wich year the entry is written.

    I would like the year to be written under the date. Between the date and clock.

    Can someone help me out how to write in the codes?
    I guess in content.php again?
    But how should the code look like?

    My blog, to take a look:
    http://xoxonicole.com/

    I got a lot of help last time about the date.

  8. LizardThemes
    Member
    Theme Author

    Posted 6 months ago #

    To add the year of posting you have to insert the code:
    echo (' '); echo get_the_date('Y');
    right after :
    `<?php echo get_the_date('M');'
    on the 4th line of the file content.php as you have already guessed.

  9. xoxoNicole
    Member
    Posted 6 months ago #

    It does not work, says eroor on that line.

    I try to make it like this, i haven't done anything beside doing exactly as you said. So they code would then look like this when i copy and paste it here from my file:

    <div class="post-date"><?php echo get_the_date('d'); ?><div class="post-day"><?php echo get_the_date('M');?echo (' '); echo get_the_date('Y');>

    I think it's the questionsmark that screws it up? Cause my line doesn't look exactly as in your example.

    Without the pasted code you gave me, my line looks like this:

    <div class="post-date"><?php echo get_the_date('d'); ?><div class="post-day"><?php echo get_the_date('M');?>

  10. LizardThemes
    Member
    Theme Author

    Posted 6 months ago #

    Hi!
    Sorry for inconvenience. The line should look like:
    <div class="post-date"><?php echo get_the_date('d'); ?><div class="post-day"><?php echo get_the_date('M'); echo (' '); echo get_the_date('Y');?>

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.