Linux 软件免费装
Banner图

Indesign Nepali Post Date

开发者 indesignmedia
更新时间 2026年8月6日 00:17
PHP版本: 8.2 及以上
WordPress版本: 7.0
版权: GPLv2 or later
版权网址: 版权信息

标签

nepali calendar nepali post date nepali date bikram sambat BS date

下载

3.0.0 1.0.0 2.0.0

详情介绍:

This plugin converts Gregorian (AD) dates into Bikram Sambat (BS) so you can display Nepali dates on posts, pages, widgets, or anywhere in your theme. Handy if you run a Nepali news site, a blog, or any WordPress site that needs BS dates for the publish date, modified date, or just today's date. What it does:

安装:

  1. Upload the indesign-nepali-post-date folder to /wp-content/plugins/, or install it from the Plugins screen.
  2. Activate it from the Plugins screen.
  3. Open Nepali Post Date in the admin sidebar and set the date format, digit style, and (if you want one) a wrapper class.
  4. Drop any of the shortcodes into a post, page, or widget: [indnpd_post_date], [indnpd_today_date], [indnpd_number number="123"], or [indnpd_post_calendar].

屏幕截图:

  • Admin: Shortcodes tab (copy-ready shortcode reference)
  • Admin: Post Calendar tab (live preview with post-links toggle and accent color picker)
  • Admin: Developer tab (PHP function, output filter, and CSS snippet)
  • Front-end: Nepali post calendar with clickable day-archive links
  • Front-end: Nepali BS date rendered on a post

升级注意事项:

3.0.0 Fixes a one-day drift in the BS calendar table and adds a post calendar shortcode. Old function names still work.

常见问题:

Which calendar does it use?

Gregorian (AD) to Bikram Sambat (BS), the official calendar of Nepal. AD 2024 lands around BS 2081.

What date range works?

BS 2000 to BS 2101 (AD 1943-04-14 to AD 2044). Dates outside that range come back unchanged.

How do I show the post date in Nepali from my theme?

Inside The Loop: <?php echo indesign_nepali_post_date_get( get_the_date('Y-m-d H:i:s') ); ?> Or if you want to pass your own format and language: <?php echo indnpd_get_date( get_the_date('Y-m-d H:i:s'), 'd M Y, l', 'nepali' ); ?> The older id_nepali_post_date_get() name still works if you already have it in your theme.

Can I use English digits?

Yes. Open Nepali Post Date in the admin sidebar and switch Localization Style to Global English (0123). You can also override it per shortcode: [indnpd_post_date lang="english"] Or pass "english" as the third argument to indnpd_get_date().

Can I change the date format?

Yes. Set your own Date Pattern in the settings, using these tokens: d (day), m (month number), M (month name), y (2-digit year), Y (4-digit year), l (weekday). For example, d M Y, l gives you २५ असार २०८१, मंगलबार. You can also pass a format directly in the shortcode: [indnpd_post_date format="d M Y"]

How do I modify the output from PHP?

Use the indesign_nepali_post_date_output filter. You get the 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 );

How do I add the Nepali calendar to a page?

Drop [indnpd_post_calendar] into any post, page, or widget. It shows the current BS month by default. Use the prev / next arrows in the header to browse. To pin it to a specific month: [indnpd_post_calendar year="2083" month="4" lang="english"]

What do the clickable days on the calendar do?

Each past-or-current day cell links to the WordPress day archive for that Gregorian date (the same URL WordPress generates for /YYYY/MM/DD/). Clicking a day takes visitors to the list of posts published on that day. Future dates are never linked.

Can I turn off the day-archive links?

Yes. Open Nepali Post Date in the admin sidebar, go to the Post Calendar tab, and switch off the Post Links toggle on the calendar preview. Save Changes. The front-end calendar will then render as a plain, non-clickable calendar.

Can I change the calendar's accent color to match my brand?

Yes. On the same Post Calendar tab, use the color picker on the calendar preview. The color drives the weekday header row, today's outline, and the linked-day text color. Save Changes and the front-end will pick it up.

Does the calendar highlight today's date?

Yes. Today (in Nepal time) is outlined with your chosen accent color, regardless of your WordPress site's timezone. The BS day always rolls at Nepal midnight.

Can I use the calendar in a widget or template file?

Yes. Widgets that accept shortcodes render [indnpd_post_calendar] directly. In a template file: <?php echo do_shortcode('[indnpd_post_calendar]'); ?>

Will the calendar work with any theme's day archive?

Yes. It uses WordPress core's get_day_link(), which produces the standard /YYYY/MM/DD/ URL. Any theme that renders the day archive template (date.php, archive.php, or index.php) will handle those links correctly.

更新日志:

3.0.0 2.0.0 1.0.0