• hi,
    i want to add this to my site so i have the current date:

    <?php echo date(‘l jS F Y’); ?>

    but 2 things. How do i position it where i want in my header?
    Im 99% sure its the style sheet.
    i just need help with coding. i can adjust it as needed if
    someone will help.

    also, i used this version:
    <div class=”date_cal”>
    <div class=”day”><?php the_time(‘l’) ?></div>
    <div class=”month”><?php the_time(‘M’) ?></div>
    <div class=”date”><?php the_time(‘d’) ?></div>
    <div class=”year”><?php the_time(‘Y’) ?></div>
    </div>

    but for one, its stacked, rather than across like the first one and two
    and probably MOST IMPORTANTLY, i move the position of it and it goes BEHIND the header image ??

    thanks for the help!

Viewing 11 replies - 1 through 11 (of 11 total)
  • put this in your header.php of your template:

    <span class="xdate"><?php echo date('l jS F Y'); ?></span>

    then define the class to your style.css file

    .xdate {
    text-align: right;
    padding: 1px 1px 1px 1px;
    }

    or add more definition on it for your style.

    Thread Starter flatsilver

    (@flatsilver)

    thank you nazcar,
    i will try that

    Thread Starter flatsilver

    (@flatsilver)

    ok, i tried it..
    its works, after i changed the ‘define’ to fit the theme i think.
    However, how do i make the letter white, rather than black?
    also, they letters still fall under the header.jpg

    ?

    insert this to the class you created:

    color: #ffffff;
    float: left;

    or right.. then adjust the padding values.

    .xdate {
    text-align: right;
    padding: 1px 1px 1px 1px;
    color: #ffffff;
    float: left;
    }
    Thread Starter flatsilver

    (@flatsilver)

    hi nazcar,
    will this keep the date above the header?
    thanks for the responses!

    Thread Starter flatsilver

    (@flatsilver)

    i tried it, its white and i can position it, but its still behind the header.

    Hi nazcar:

    Excuse me my ignorance (and my poor english), but I do not understand very well your explanation:

    1. In which exact place of header.php I must put the code?
    2. In which exact place of style.css I must put the class?

    Thanks for your help!

    @leorrueda
    where you need to put the code depends on your header.php code and the location where you want the date to show.
    in any case, it has to be below the <body> tag.

    maybe you could explain that a bit more, and post a link to your blog.

    it might also help if you copy the code of header.php into a https://wordpress.pastebin.com/ and post the link to it here.

    the location in style.css is not very important, because you are using a new class for the date.

    Thanks alchymyth!

    I will try to follow your suggestion and if I have some problem I will post here the link of the code.

    Thanks again!!

    I could put the date in header. Thanks alchymyth.

    The problem I have now is that the date it seems in english and I would need it in spanish. Can you or somebody you help me?

    ed

    (@wesleysoccer)

    <span class=”xdate”><?php echo date(‘F jS Y |’);?></span>

    Does anyone know how to change the above to Eastern Standard Time?

    I have it working great…just it seems to be about 5 hours ahead…thanks

    https://wesleysoccer.webfactional.com/blog/

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to add date to my header ( i read previous post, i promise)’ is closed to new replies.