资源说明:
=== Countdown Timer === Contributors: fergbrain Donate link: http://www.andrewferguson.net/2007/03/08/general-note/ Tags: countdown, timer, count, date, event, widget, countup, age, fun, time, international, i18n, countdown timer, wedding, localization, i18n Requires at least: 4.0 Tested up to: 4.8 Stable tag: 3.0.7 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html This plugin allows you to setup a series of dates to count to or from in terms of years, months, weeks, days, hours, minutes, and/or seconds. == Description == Countdown Timer allows you to setup one or more dates to count down to or away from. Events can be inserted into the sidebar using the widget, or within posts and pages using shortcodes. Currently supports 22 languages. == Translations == = Using another language = You'll need to modify your wp-config.php file. To do this... 1. Open your `wp-config.php` file in a text editor and search for: `define ('WPLANG', '');` 1. Edit this line according to the language you want to use (and is available). For example, for Deutsch spoken in Germany, you must add: `('WPLANG', 'de_DE');` 1. Once you've added your language code, save the file. 1. Upload the modified wp-config.php file into the WordPress root directory. Of course, you'll replace de_DE with the language extension that you want to use, unless of course you actually did want the German language translation. For more information, consult [Installing WordPress in Your Language](http://codex.wordpress.org/Installing_WordPress_in_Your_Language) on the WordPress Codex = Languages Available = * Bosnian translation: bs_BA * Catalan (Spain) translation: ca_CA * Czech translation: cs_CZ * Danish translation: da_DK * German translation: de_DE * Spanish translation: es_ES * French translation: fr_FR * Hungarian translation: hu_HU * Italian translation: it_IT * Lithuanian translation: lt_LT * Latvian translation: lv_LV * Dutch translation: nl_NL * Norwegian translation: nn_NO * Polish translation: pl_PL * Portuguese [Brazil] translation: pr_BR * Romanian translation: ro_RO * Russian translation: ru_RU * Serbian [Cyrilic] translation: sr_RS * Swedish translation: sv_SE * Turkish translation: tr_TR * Vietnamese translation: vi_VI * Chinese translation: zh_CN == Installation == 1. Install the plugin using your preferred method of choice. Using the built-in WordPress installer is the preferred choice, but you can also do things the hard/manual way. 1. Activate the timer. 1. Events can be added and other settings modified in Settings > Countdown Timer in The Dashboard. = Inserting countdown timers into your blog = There are three places you can insert a countdown timer: 1. Sidebar (using the widget) 1. A post or page (using shortcodes) 1. PHP (experts only) = Adding to the sidebar = Add the widget to the sidebar by going to Appearances > Widget in The Dashboard. = Adding to a post or page = If you want to insert the Countdown Timer into a page or post, you can use the following shortcodes to return all or a limited number of Countdown Timers, respectively: `[fergcorp_cdt]` `[fergcorp_cdt max=##]` Where _##_ is maximum number of results to be displayed, ordered by date. If you want to insert individual countdown timers, such as in posts or on pages, you can use the following shortcode: `[fergcorp_cdt_single date="ENTER_DATE_HERE"]` Example: `Time until our wedding: [fergcorp_cdt_single date="08 December 2012"]` Where "ENTER_DATE_HERE" uses PHP's strtotime function and will parse about any English textual date/time description (such as "08 December 2012"). A complete list of valid formats can be found on PHP's [Supported Date and Time Format](http://www.php.net/manual/en/datetime.formats.php) page. = PHP = Countdown Timer also provides a PHP function designed to be accessed publicly so you can include it in elements of your site that may not be in The Loop. `fergcorp_countdownTimer(##)` Where _##_ is the maximum number of events you wish to be displayed. If _$maxEvents_ is not given, the function will return all timers. Events are automatically sorted by date of occurrence. Note: You should also encapsulate calls with "function_exists" to prevent unintentional fatal errors if the plugin is deactivated. = Limiting the number of countdown timers displayed = If you're using the widget, there is an option to set the maximum number of timers shown. If you are using the PHP code, _$maxEvents_ is the maximum number of events you wish to be displayed. Events are automatically sorted by date of occurrence. = Changing the font, size, and style using CSS = You can makes changes to the appearance of Countdown Timer display using CSS. The following CSS classes are available: * `fergcorp_countdownTimer_event_li` styles each List Item, each item encompasses one countdown event * `fergcorp_countdownTimer_event_title` styles the title of the event * `fergcorp_countdownTimer_event_linkTitle` styles the title of an event if it is linked * `fergcorp_countdownTimer_event_time` styles the actual countdown timer * `fergcorp_countdownTimer_timeUnit` styles the units (e.g. "25 days") * `fergcorp_countdownTimer_year` styles the year text * `fergcorp_countdownTimer_month` styles the month text * `fergcorp_countdownTimer_week` styles the week text * `fergcorp_countdownTimer_day` styles the day text * `fergcorp_countdownTimer_hour` styles the hour text * `fergcorp_countdownTimer_minute` styles the minute text * `fergcorp_countdownTimer_second` styles the second text == Frequently Asked Questions == = How do I prevent the timer from wrapping my countdown? = Add the following to your CSS file: .fergcorp_countdownTimer_timeUnit {white-space: nowrap;} = I have JavaScript countdown enabled and it works on the administration page in the Example Display, but not on my main site! = This, unfortunately, is a problem with your theme, and not with Countdown Timer. Themes _must_ call wp_footer(), which is a standard hook for WordPress. Without it, many other plugins may not work properly either. Your best bet to fix the problem is to modify the `footer.php` file and put `` right before `