Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

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

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


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
 
Prev Previous Post   Next Post Next
  #1  
Old Dec 7, 2011, 08:12 PM
juggledad's Avatar
juggledad
 
22,370 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
A Christmas Present from Juggledad - A liturgical 'background' color script

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 12:51 PM.
 

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 09:21 AM
[SOLVED] Different title color and byline background color for different categories? chiara7 Post-Kicker, -Byline & -Footer 1 Sep 9, 2009 07:01 PM
juggledad is a moderator! Flynn Atahualpa 3 Wordpress theme 0 May 30, 2009 08:41 PM
How do you make a right side bar on "Page" pages present different content nasu Sidebars & Widgets 4 May 25, 2009 08:11 PM
Fixed width site. Different page background color from body color? blueprairie Forum How-To 1 Mar 20, 2009 09:55 PM


All times are GMT -6. The time now is 06:26 AM.


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