• I have tried to find a method of doing this but my queries get confused with changing an entire style sheet based on date. Not what I want.

    I have a table in one of my sites. Within this table I have listed items by date. I have been manual;y changing the tr class from something like current to something like old. This switches the text in that row from prominent to faint, denoting the passage of time.

    Is there a way I can set a class to switch from one to another based on a specific date set? Thus removing my need to do this by hand at the time and allow me to setup a years schedule in advance.

    I figure there must be a way.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I have a table in one of my sites. Within this table I have listed items by date. I have been manual;y changing the tr class from something like current to something like old.

    Within this table I have listed items by date

    is that in a template, or in the content of post/page?

    what is the full code of this table?
    (please follow http://codex.wordpress.org/Forum_Welcome#Posting_Code when posting code)

    Thread Starter ekdor

    (@ekdor)

    Hi, thanks for your response.

    Ok… First, the table is straight HTML table code inserted as content within a page, and it’s not really relevant I don’t think, I just mentioned it as background to my question. It is the only page in the site using a table. Also happens to be where I especially want to use a date switching class, although it might be useful else where later. I have found code that switches entire style sheets. I wasn’t sure if I could modify it to my own ends.

    Maybe I need to clarify my question without the unnecessary stuff I added before.

    KISS Example:

    Imagine two separate pieces of text which are encased individually in a div or span with a class and date assigned. One might be March,21 and the other might be July,12. So, before the date has occurred it uses the first, class=”before” which specifies black text in the style sheet. After the date has occurred it uses the second, class=”after” which specifies grey text in the style sheet.

    This could be used in a variety of ways. For example, what I want is to have our yearly schedule cross off events as they have occurred without me doing it manually. Or one could add an item and give it the date of publication and it places a “NEW” sign to the entry which can be set to expire after a set time. Or to have a section of text appear to vanish completely after a set date.

    Anyway I gather that’s a better explanation? Cheers,.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘one css style change based on date’ is closed to new replies.