Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

A Christmas Present from Juggledad - A liturgical 'background' color script


  #1  
Old Dec 7, 2011, 07:12 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Updated for 2013

Here is a little present for anyone working on a christian church web site (if you're of another religion and your faith uses different colors to represent different times of the year - you could could yuse this too.)

this jscript gets todays date then checks thru a bunch of dates to set the color based on the time of year. It then changes the pages background color to match. Check the dates to make sure they match your liturgical calendar.

HOW TO USE IT
1) go to ato->Body, Text & Links and remove the 'background' and/or 'background-color' statement that might be there
2) add the following to ato->Add HTML/CSS Inserts->HTML Inserts: Body Bottom
HTML Code:
<script type="text/javascript">
	/* Set the colors */
	lc_black  = '#000000';  /* black */	
	lc_blue   = '#336699';  /* lightblue */	
	lc_gold   = 'gold';     /* gold */
	lc_green  = 'green';    /* green */
	lc_orange = '#FBA02A';  /* orange */
	lc_violet = '#7134C3';  /* purple */
	lc_red = '#aa1c10'; 	 /* red */
	lc_white  = '#FFFFFF';  /* white */	

	/* get todays date and put in yyyymmdd format */
	d = new Date();
	lc_dd = d.getDate();
	lc_mm = d.getMonth()+1;
	lc_yyyy = d.getFullYear();
	lc_today = (lc_yyyy*10000) + (lc_mm*100) + lc_dd;

	/* set the color for the general days */
	if (lc_today >= 2012 12 24) { lc_color = lc_white; }  /* 12/24/12 - 01/19 - White (Christmas Eve, Christmas, 1st Sunday after Christmas, 1st Sunday after Epiphany) */
	if (lc_today >= 2013 01 20) { lc_color = lc_green; }  /* 01/20/13 - 02/09 - Green (Ordinary Time) */
	if (lc_today >= 2013 02 10) { lc_color = lc_white; }  /* 02/10/13 - 02/12 - White */
	if (lc_today >= 2013 02 13) { lc_color = lc_violet; } /* 02/13/13 - 03/27 - Violet - can use Violet or Red on 4/1 for Palm Sunday (Lent) */
	if (lc_today >= 2013 03 28) { lc_color = lc_white; }  /* 03/28/12           White (Maundy Thursday) */
	if (lc_today >= 2013 03 29) { lc_color = lc_black; }  /* 03/29/13 - 03/30 - Black (Good Friday/Holy Saturday) */
	if (lc_today >= 2013 03 31) { lc_color = lc_white; }  /* 03/31/13 - 05/18 - White (Easter Season) */
	if (lc_today >= 2013 05 19) { lc_color = lc_green; }  /* 05/19/13 - 05/25 - Red (Pentecost) */
	if (lc_today >= 2013 05 26) { lc_color = lc_green; }  /* 05/26/13 - 10/13 - Green (Ordinary Time) - Red on 10/28 (Reformation Sunday) */
	if (lc_today >= 2013 11 01) { lc_color = lc_white; }  /* 11/01/13 - 11/02 - White (All Saints day) */
	if (lc_today >= 2013 11 03) { lc_color = lc_green; }  /* 11/03/13 - 11/30 - Green (Ordinary Time) - Red on 10/28 (Reformation Sunday) */
	if (lc_today >= 2013 12 01) { lc_color = lc_violet; } /* 12/02/01 - 12/23 - Violet or Blue - can also use Rose on 12/16 for 3rd Sunday of Advent (Advent Season) */
	if (lc_today >= 2013 12 24) { lc_color = lc_white; }  /* 12/24/13 - ???? - White - I'll have to wait for the 2013 calendar!!!! */


	/* set the background color */
	document.bgColor = lc_color; 
</script>
That's it you're done. If you want to test it out, you can set lc_today to any date to see the background change

Enjoy and Merry Christmas
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Dec 26, 2012 at 11:51 AM.
  #2  
Old Dec 16, 2011, 01:58 PM
ARealpolitik's Avatar
ARealpolitik
 
130 posts · Jun 2010
Any demo site available?
  #3  
Old Dec 16, 2011, 03:22 PM
KatyDigg's Avatar
KatyDigg
 
319 posts · Jul 2009
Thank you, Juggledad

I've only just spotted this, and delighted

"Happy Christmas"

~ Katy
  #4  
Old Dec 16, 2011, 03:35 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
ARealpolitik - hang on and I'll put it on a site - I'll change the code so it does it checks the seconds and every 5 seconds (on a page refresh) it will change color

might not be till later tonight since the little one is visiting (grandkids are sooo much fun)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Dec 26, 2012, 12:38 AM
kletskater's Avatar
kletskater
 
93 posts · Jun 2010
hi juggledad,
how to adjust the code for 2012 or 2013?
or is that not nessesary?
  #6  
Old Dec 26, 2012, 04:59 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
I will adjust it, I just have to get the dates (I use it on my church's website )
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Dec 26, 2012 at 05:03 AM.
  #7  
Old Dec 26, 2012, 08:57 AM
kletskater's Avatar
kletskater
 
93 posts · Jun 2010
oke thanks, want to try make my Ata have a xmas look :-)
  #8  
Old Dec 26, 2012, 12:01 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
It has been updated for 2013
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Merry Christmas & Happy New Year 2010! liabelle Atahualpa 3 Wordpress theme 0 Dec 23, 2009 08:21 AM
[SOLVED] Different title color and byline background color for different categories? chiara7 Post-Kicker, -Byline & -Footer 1 Sep 9, 2009 06:01 PM
juggledad is a moderator! Flynn Atahualpa 3 Wordpress theme 0 May 30, 2009 07:41 PM
How do you make a right side bar on "Page" pages present different content nasu Sidebars & Widgets 4 May 25, 2009 07:11 PM
Fixed width site. Different page background color from body color? blueprairie Forum How-To 1 Mar 20, 2009 08:55 PM


All times are GMT -6. The time now is 01:31 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.