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
  #1  
Old Dec 7, 2011, 07:12 PM
juggledad's Avatar
juggledad
 
22,188 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
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
__________________
Give a person a solution, you fix one issue, teach a person how to solve their problem you enable them forever.
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
 
318 posts · Jul 2009
Thank you, Juggledad

I've only just spotted this, and delighted

"Happy Christmas"

~ Katy
__________________
UniServer | WP 3.9 | ThemeFrame 1.2.6 | Montezuma 1.1.9 | ATA 3.7.13
  #4  
Old Dec 16, 2011, 03:35 PM
juggledad's Avatar
juggledad
 
22,188 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
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)
__________________
Give a person a solution, you fix one issue, teach a person how to solve their problem you enable them forever.
Juggledad | Forum Moderator/Support
  #5  
Old Dec 26, 2012, 12:38 AM
kletskater's Avatar
kletskater
 
85 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
 
22,188 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
I will adjust it, I just have to get the dates (I use it on my church's website )
__________________
Give a person a solution, you fix one issue, teach a person how to solve their problem you enable them forever.
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
 
85 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
 
22,188 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
It has been updated for 2013
__________________
Give a person a solution, you fix one issue, teach a person how to solve their problem you enable them forever.
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 12:17 PM.


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