| 开发者 | indesignmedia |
|---|---|
| 更新时间 | 2026年4月22日 19:11 |
| PHP版本: | 8.2 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
indesign-nepali-post-date folder to the /wp-content/plugins/ directory, or install it directly through the WordPress plugin screen.[indnpd_post_date] or [indnpd_today_date] anywhere in your content.The plugin converts dates from the Gregorian calendar (AD) to the Bikram Sambat (BS) calendar — the official calendar of Nepal. For example, AD 2024 corresponds approximately to BS 2081.
The plugin supports BS 2000 to BS 2101, which corresponds to AD 1943-04-14 through AD 2044. Dates outside this range will be returned as-is without conversion.
Use the global PHP function anywhere inside The Loop:
<?php echo id_nepali_post_date_get( get_the_date('Y-m-d H:i:s') ); ?>
Or use the namespaced helper for more control:
<?php echo indnpd_get_date( get_the_date('Y-m-d H:i:s'), 'd M Y, l', 'nepali' ); ?>
Yes. Go to Settings → Indesign Nepali Post Date and set Localization Style to Global English (0123). You can also override this per shortcode using the lang attribute:
[indnpd_post_date lang="english"]
Or per function call by passing "english" as the third argument to indnpd_get_date().
Yes. In the settings panel, enter a custom Date Pattern using the supported tokens: d (day), m (month number), M (month name), y (2-digit year), Y (4-digit year), l (weekday name). For example, d M Y, l outputs २५ असार २०८१, मंगलबार.
You can also pass a custom format directly in a shortcode: [indnpd_post_date format="d M Y"]
Use the indesign_nepali_post_date_output WordPress filter. It passes three arguments: the formatted HTML string, the BS date array, and the Unix timestamp.
add_filter( 'indesign_nepali_post_date_output', function( $html, $bs, $unix ) { return '<span class="nepali-badge">' . $html . '</span>'; }, 10, 3 );
indesign_nepali_post_date_output filter for developer customization.indnpd_get_date() namespaced helper function.Manager::convert() static API method.