BNS Body Classes
Simple plugin that adds classes to the body_class output upon activation, including: a full list of date related classes; a few holiday classes; and, a generic sample full calendar extension.
Download
Latest version: Download BNS Body Classes v0.5.2 [zip]
Installation
This section describes how to install the plugin and get it working.
- Go to the “Plugins” menu in the Administration Panels (“dashboard”).
- Click the ‘Add New’ link.
- Click the “Upload” link.
- Browse for the bns-body-classes.zip file on your computer; upload; and, install accordingly.
- Activate.
– or -
- Go to the “Plugins” menu in the Administration Panels (“dashboard”).
- Click the ‘Add New’ link.
- Search for BNS Body Classes.
- Install.
- Activate.
Please read this article for further assistance: http://wpfirstaid.com/2009/12/plugin-installation/
FAQ
Q. How do I activate the calendar extension?
A. Included with the package is the file named ‘bnsbc-calendar-sample.php’; simply rename this file to ‘bnsbc-calendar.php’, then edit it to add your own date-specific classes.
As the specifically named file ‘bnsbc-calendar.php’ is not included with the standard plugin package it will survive any automatic updates via the WordPress Administration Panels.
Q. How do I add a new class in the calendar extension?
A. After changing the sample file to ‘bnsbc-calendar.php’ simple find the date you want to add the class to and amend that line.
For example, to add a class for the Ides of March you would edit the March 15 entry and add an appropriate class such as:
- near line 138: if ( ’15′ == date( ‘d’ ) ) { $dates .= ”; } would change to if ( ’15′ == date( ‘d’ ) ) { $dates .= ‘ ides-of-march’; }
NB: Remember to use “safe” characters for class names; and, add a single preceding space to eliminate the risk of classes running together.
Changelog
0.5.2
- Released April 2013
- Added $classes parameter in calendars to be able to append new date classes
0.5.1
- Released April 2013
- Fixed wrong function being called by action hook
0.5
- Released April 2013
- Added additional related tags to header block
- Added Christian Calendars for the years 2013 and 2014
- Added Jewish Calendars for the years 2013 and 2014
- Code formatting and code block termination comments
0.4
- Released December 2012
- Added conditional check on
option_classes - Added generic (sample) calendar extension
- Added more common dates: Valentine’s Day, St. Patrick’s Day, April Fool’s Day, Halloween, Remembrance Day
- i18n updates
- Prepared for extension plugins
- Refactored options to more appropriate naming conventions
- Updated descriptions and FAQ to reflect new features
0.3
- Released December 2012
- Add “Current Date” classes
- Add “Holidays” classes (Christmas and New Years)
- Refactored main plugin file to OOP code format
0.2.2
- Tested compatible with WordPress 3.4
0.2.1
- Corrected issue with initial empty array being fed to the
implodefunction
0.2
- Add options page to include custom classes
0.1
- Initial Release – January 2012
