Hebrew Date Plugin
Created by KosherJava on June 26, 2005 - כ' סיון תשס"ה
Update: The Wordpress Hebrew Date Plugin Has a New Home!
The Hebrew date plugin is a simple plugin that displays Hebrew dates alongside the current Grgorian dates. The default format currently used is the Gregorian and Hebrew format:
June 24th, 2005 - י"ז סיון תשס"ה
You can optionally output the Hebrew date in the Latin charset (English) to display:
June 24th, 2005 - 17 Sivan 5765
To change this setting, change the line
$jewishDateStyle = “HEBREW_AND_GREGORIAN”;
to
$jewishDateStyle = “JEWISH_AND_GREGORIAN”;
(Both are in the code but one line is //commented out.)
An other option is the spelling of the Jewish month names when using the Latin charset. This can either use the default Ashkenazi pronounciation of Cheshvan & Teves, or the Sefardic prounounciation of Heshvan and Tevet.
To change to the Sefardic spelling, change:
$useAshkenaziSpelling = true;
to
$useAshkenaziSpelling = false;
Version 0.9 is now available for your testing.
This plugin will output Hebrew and Gregorian dates in Wordpress. This has not been tested on WP 1.2 and will probably not work in anything less than 1.5. To activate, unzip, copy to the plugin directory and enable. That’s it. No theme changes should be required.
The code is a drop rough and relies on the detection of a ‘:’ in the Date String to determine that it is a time and not date. This works well with the default Wordpress 1.5 theme (Kubrick). Other themes that use alternate date formatting might not work perfectly with this plugin (but probably will work fine).
Related Posts
- The Wordpress Hebrew Date Plugin Has a New Home!
- Wordpress Hebrew Date Plugin Alpha Release
- New Version of the Hebrew Date Plugin Available
- Hebrew Date Plugin Version 0.9 Released
[…] June 26th, 2005 WordPress Plugin: Hebrew Date Hebrew Date is a WordPress 1.5 plugin that displays Hebrew dates alongside the current […]
[…] o; Plugin WordPress: SearchHistory Plugin WordPress: Hebrew Date Hebrew Date è un plugin che visualizza la data in ebraico a fianco della “class […]
over all a great plugin, however you seem to have left out a bit of code that deals with leap years. All my posts from adar I are messed up as a result. To see an example of the error message check out:
February Posts
I’d appreciate ny updates to this that you are able to do. Like I said I otherwise love the plug-in.
José,
As mentioned in the posting Hebrew Date Plugin Version 0.9 Released, I just uploaded version 0.9 that has the missing function. Please test it and let me know if it works.
I’m new to WordPress and your Hebrew Date Plugin (ver 0.9) and I’m having some trouble. When I activate the plugin it errors out on the site at line 70. It says:
Fatal error: Call to undefined function: gregoriantojd() in /sites/ariellovesdana/html/wordpress/wp-content/plugins/hebrewdate.php on line 70
Am I missing something? Any help would be greatly appreciated. Thanks!
In order to use international date functionality (including Julian dates needed for the conversion of Jewish dates), PHP has to be compiled with
–enable-calendar
You should get in touch with your web hosting company about this.
Shalom KosherJava:
I’ve been using your Hebrew date plugin ever since I started using WordPress, and I really like it.
I’m wondering how easy it would be to add the capability of displaying occasions for the given date, (for instance, any entries displaying 1 Heshvan also displaying Rosh Hodesh, or the days of the week being displayed as “First Day of Parshat … “. Any help you can provide would be appreciated.
Thanks in advance, and g’mar chatimah tovah.
Adding Jewish holidays would not be complex, but it is not something I plan on adding in the near future unless I find a lot of spare time. Doing it would require adding them in both Hebrew and English. A higher priority would be to get the plugin to work with the Hebrew localization of Wordpress, something that it does not seem to do now. I’ll keep it in mind for a future version though.
Shalom, Shana Tova!
I am happy to use this plugin it is beautiful thing for my site thank you.
Could you tell me how i can add to my sidebar a date with latin/hebrew so it shows the current date please.
I posted a question but it appears to be delted and unanswered. I want to put in my sidebar the current date like your plugin does in posts. please advise how to do this
I’m just installed & activated Hebrew Date Plugin - my very first WordPress plugin - but I can’t figure out why it doesn’t work. I checked on two different themes. I don’t get an error message; I get nothing.
Nathan,
What version of WordPress are you using? The plugin only works on 1.5. If you are using 1.5, does it wotk with the default theme (my site is using the default)?
I’m using WP 1.5 and yes, Hebrew date seems to work fine on the default theme. On the theme that I’m using, Mike Little’s Journalized-blue, I get the Hebrew date in comments, but nowhere else.
Any idea how to edit the theme or the plugin to get them working together?
Makki,
By looking at your site, it seems that you got it working.
KosherJava yea well i entered it manually i would like it if the plugin would do it for me.
I don’t think a plugin can arbitrarily put a date in a sidebar. such information is always embedded in the theme. Even if there was an automated way to do it, chances are that you would not like the place it ended up in. Embedding it in the theme gives you more control.
I asked Mike Little and here’s what he said:
The plugin only wraps calls to the_time() (and get_comment_date()) and adds the Hebrew date to the end. My theme uses the_date().
To fix it with my theme, you need to replace the call to the_date() with a call to the_time().
In index.php around line 14 replace
`’,”);?>`
with
“
Then in page.php at the end of line 16 replace
` @ on .`
with
`on .`
Just wanted to drop by and point out that Mike Little graciously answered this for me. Here’s what he wrote (sorry about my first try; the code didn’t show up):
The plugin only wraps calls to the_time() (and get_comment_date()) and adds the Hebrew date to the end. My theme uses the_date().
To fix it with my theme, you need to replace the call to the_date() with a call to the_time().
In index.php around line 14 replace
‘,”);?>
with
Then in page.php at the end of line 16 replace
@ on .
with
on .
All right, I obviously can’t manage to make the code appear here. If anyone wants to get the Hebrew Date plugin working with Journalized blue, please look at:
http://wordpress.org/support/topic/47225
Nathan,
Thanks for the tip on figuring this out. I have no time to look into this now, but can the plugin wrap calls to the_date()?
Try wrapping the code with the following syntax. Just remove the space after the [ and before the ]
[ code lang=”php” ]
[ /code ]
[code lang=”php”]
< ?php
print "test";
?>
[/code]
Do you know how this plugin could be implemented in Textpattern? I would really like to be able to display Hebrew dates on my new site.
Thanks
Your posting was the first I ever heared of Textpattern, though I had no trouble finding it at http://textpattern.com/ . The code is very straight forward and built from code that I wrote for PhpGedView. Support for the Jewish calendar is built into PHP so writing the code was not complex. Turning the code into a Wordpress plugin was simply a matter of using the Wordpress Plugin Hooks and a few small tweaks. You need to find out how to use similar hooks with Textpattern (assuming that they exist).
Okay, thanks. I’ll look into it.
[…] At the request of a gentle reader, I’m testing the HebrewDate plugin. Looks like it works just fine not only on the main page but on each individual entry page as well. […]
Hi,
I’m using the hebrew version of wp (trans.co.il/wp). The hebrew date plugin doesn’t work as expected.
I had to make extreme changes to jewish_date(), and now it works for me. The changes are ont suitable for sending back, but let’s communicate in email if you are interested..
Yuval,
As I mentioned in my
comment on the Hebrew WP page, this was not tested with the localized Hebrew version. I am grateful that you not only tested it, but actually fixed it. I will be in touch with you via email on getting the fixes in.
Just wanted to let you know that I used this in WP 1.5 and it’s looking great. Is there a way to disable the gregorian date?
To disable the Gregorian date change line 99 from
[code lang=”php”]return date($date_format, $pdate) .’ - ‘ . $convertedDate;[/code]
to
[code lang=”php”]return $convertedDate;[/code]
Hy everybody, I’m an italian webdesigner, so I start my help request apologizing for my broken english
Thanx to Kosherjava who give us the plugin. I’m triing to use it for the upcoming site ( www.levchadash.info) of a liberal Sinagogue in Milan, Italy.
I installed the plugin, but it doesn’t work.
It prints a fake date: “1 January 1970 - 23 Tevet, 5730″ even the time flows
I use wordpress 2.01, italian version.
I’m not very skilled in PHP.
Maybe the problems are both version and localization of WP?
I home someone can help me.
Thank you in advance,
Shabbat Shalom
Lev,
It is likely the localized version of the plugin. I have not tested it on 2.0, but I do know that others have had no problem with it running on 2.0. If you look at the source code of the plugin on line 44, you will see an array of month names with a comment after it about localization issues. Try replacing that line with Italian, and let me know if it solves your issue. There have also been some theme specific bugs, so I am not sure that this will solve your issue. I have a feeling that changing the array in line 44 might not solve your issue, since there a lot of assumptions in the code regarding date formats that might not be applicable for your local.
[…] What is there left to- procrastinate work with do? - Update the header image. - fix loose change category display - write a knitting projects plugin that is similar to rob’s now reading plugin. - figure out the changes rob made and get stuff displaying again. - clean the apartment - update knitting gallery - fix image display - fix redirects of /pocketchange to /pgponders - go to sleep - fix hebrew date plugin - fix CSS again (i knew i’d break it. drat!) […]
[…] What is there left to- procrastinate work with do? - Update the header image. - fix loose change category display - write a knitting projects plugin that is similar to rob’s now reading plugin. - figure out the changes rob made and get stuff displaying again. - clean the apartment - update knitting gallery - fix image display - fix redirects of /pocketchange to /pgponders - go to sleep - fix hebrew date plugin - fix CSS again (i knew i’d break it. drat!) […]
Thanks. Works well. I really appreciate your work.
תודה

[…] you have probably noticed by now, I added a plugin that adds the Hebrew date in a normal font to the posts and comments. Unfortunately, this plugin […]
[…] do want to stress a point: the main reason for this plugin was that the wonderfull HebrewDate-plugin by KosherJava (which I also use on this weblog) couldn’t show the current hebrew date in the […]
Shalom,
I installed hebrew-data-plugin (which seems awesome and very much needed, by the way is there a hebrew calendar wordpress plugin?) and activated it in wordpress 2.1, but I might by a little bit “a wordpress newbie”, coz’ I haven’t a clue how I make it work, so that I can see it. I put $jewishDateStyle to some where, but where in my theme’s code?
As mentioned , this plugin has a new home, and the version here is out of date. Please go to mikeage.net’s Hebrew Dates in Wordpress page. If you run into an issue with his latest version, please let mike know. The issue is I am sure related to the Finnish (European) date format that your site is using.
[…] plugin that provides Hebrew dates in Wordpress. Based on the Hebrew Date plugin by […]
Is it possible not to have the name of the mounth, just the number?
Thanks for a great plugin.
Petrus,
I am happy that you are enjoying the plugin. Your request is not a complicated to implement, but as mentioned above, I no longer maintain the plugin. The latest version is maintained by Mike Miller. Please post at Mike's site regarding this.