Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2014
    Location
    Oklahoma
    Posts
    22
    Plugin Contributions
    0

    Default Date and Time in Header need to be in white

    Hi,

    I am adding the code to display the time & date in my header but have run into a slight problem. My background is black so I need to change the output to white text. I've searched the web and can't seem to find code to include to make it white.

    I think I would also like to center it but not having much luck there either.

    Any help would be appreciated.

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Date and Time in Header need to be in white

    We'll need a link to your site. Use this format: mysiteDOTcom.

  3. #3
    Join Date
    Feb 2014
    Location
    Oklahoma
    Posts
    22
    Plugin Contributions
    0

    Default Re: Date and Time in Header need to be in white

    Here it is

    papastemplatesdotcom

    Thanks in advance

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Date and Time in Header need to be in white

    Quote Originally Posted by CarlC View Post
    I've searched the web and can't seem to find code to include to make it white.
    Well, there's your problem. You'll be better of restricting the search to your website rather than the entire web. :)

    Quote Originally Posted by CarlC View Post
    I think I would also like to center it but not having much luck there either.
    Using the Developers Toolkit (admin->tools) enter bof-display today date and time into the Look-up in all files box.

    This will identify the page you'll need to edit. (probably tpl_header.php)

    You'll probably need to either add or define a 'style' to the code that creates the output, because by default it is using 'logoWrapper' style which is also 'shared' by several other wrappers.

    Hmmm, you *MAY* be able to achieve what you want by simply by adding the following to your stylesheet

    #logoWrapper {
    color: white;
    }

    I say 'may' because this will have a possible side effect of changing other text to also be white, even where not needed, or, if the existing definition of logoWrapper is read *after* yours, then yours will have no apparent effect. (either delete the existing definition, or ensure that yours is the last one to be read)

    Cheers
    RodG

  5. #5
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Date and Time in Header need to be in white

    Quote Originally Posted by CarlC View Post
    Any help would be appreciated.
    Update:
    Add this too your stylesheet instead of my previous suggestion.

    #headerWrapper {
    color: white;
    }




    This doesn't appear to have any unwanted side effects (on your site)

    Cheers
    RodG

  6. #6
    Join Date
    Feb 2014
    Location
    Oklahoma
    Posts
    22
    Plugin Contributions
    0

    Default Re: Date and Time in Header need to be in white

    Hi RodG,

    Thanks for the help I tried all of your examples but neither works. The code I inserted into the tpl_header was the code that was posted in the plugins from here.

    <!--bof-display today date and time-->

    <?php

    echo date('l jS F Y - h:ia');

    ?>

    <!--eof-display today date and time-->

    I thought there was a way to have a color specified when using echo, but the only one I found didn't work. Its not that important but I thought it would be a good idea as I'm developing the site.

    Appreciate your help
    Carl

  7. #7
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Date and Time in Header need to be in white

    Quote Originally Posted by CarlC View Post
    I thought there was a way to have a color specified when using echo, but the only one I found didn't work.
    There is.

    Try this:
    Code:
    <!--bof-display today date and time-->
    
    <?php
    
    echo "<div style=\"color:white\">" ;  
    echo date('l jS F Y - h:ia');
    echo "</div>" ; 
    
    ?>
    
    <!--eof-display today date and time-->
    There ARE better ways to do this (such as "<div class='xxxxx'> or '<div id=xxxxx>' and then adding this new class/id to your stylesheet, but for a quick n dirty fix, the inline style should work ok.

    I suspect the other changes I suggested had no effect due to where the change was made. However, my second suggestion did have the desired effect when I tried it.

    Anyway, handy hint time. If you install Firefox (or Chrome) with the developer plugin, you can right-click on any page element (such as where your date/time display is) then 'Inspect Element' you'll be greeted with a .css editor of sorts. Although it can look daunting at first with a bit of playing around you'll start to realise exactly what you are looking at, and you can start to make many changes in regards to how the site looks. If you screwup (and you will), just refresh the page and start again. The changes you make won't be permanent, so when you DO find what you want, just take note of the stylesheet (and line#) and then manually apply the same changes to the actual file.

    Be careful though. Playing with the .css on a live site can be very addictive (and fun). :)

    Cheers
    Rod

  8. #8
    Join Date
    Dec 2010
    Location
    UK
    Posts
    1,771
    Plugin Contributions
    3

    Default Re: Date and Time in Header need to be in white

    Quote Originally Posted by RodG View Post
    Update:
    Add this too your stylesheet instead of my previous suggestion.

    #headerWrapper {
    color: white;
    }




    This doesn't appear to have any unwanted side effects (on your site)

    Cheers
    RodG
    CarlC, the code that RodG posted *should* work. You did try it by adding it to your stylesheet.css didn't you??

 

 

Similar Threads

  1. Sales or Specials with Time and Date (instead of date only) Expiration
    By townsend2009 in forum Setting Up Specials and SaleMaker
    Replies: 3
    Last Post: 29 Jan 2015, 07:56 PM
  2. Date and Time
    By motor in forum General Questions
    Replies: 2
    Last Post: 14 May 2007, 08:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR