You don’t need to change any code.
get_the_date without an argument will use the date_format option in your WordPress settings. The option F j, Y
will substitute F
as “September”, but if you have a translation of “September” it will be used.
Comments have suggested the use of date_i18n. This is used automatically when you call get_the_date(). Translations of the days and months are in WordPress core and will be used if installed. e.g. The Chinese translation of “September” is here,
However, if you want to print “2017年9月13” I think you will have to set a custom format in your WordPress settings as:
Y年m月d
Under Settings > General > Date Format, select “Custom” and enter that into the field. I’ve tested that and it formats the Chinese characters just fine.
Related Posts:
- gettext localization is not working
- Check if Post Title exists, Insert post if doesn’t, Add Incremental # to Meta if does
- How to get a translated string from a language other than the current one?
- Localization: I want the backend: english and frontend in defined language
- Sanitizing integer input for update_post_meta
- Meta compare with date (stored as string) not working
- How to update/insert custom field(post meta) data with wordpress REST API?
- What is the purpose of an extra file for translation?
- Problems with localization
- Front-end update_post_meta snippet displays white screen?
- How to get meta value in wp_attachment_metadata
- Clean up output added via wp_head()
- How to load theme textdomain from plugin?
- Change language of comments template
- adding a URL to a post meta
- Short of raw SQL, can I query for multiple attachment metadata that have a given array key?
- get_post_custom()
- POEdit with Custom mu-plugins code
- Mass importing json data into custom fields (postmeta)
- How to echo get_post_meta (Fluent-Framework)
- How to add meta data to WordPress posts?
- Proper use of internationalization
- Localization: Textdomain of Child teme
- How add post_meta from user_meta?
- get_post_meta remains empty while looping all menu items and using the ID
- how do I set a schedule event to modify all posts’s meta value weekly or monthly?
- How to stop wp_postmeta from being called on archive and search pages?
- Translations not returning translated strings
- Activate Child Theme .mo and .po files
- WordPress front-end media (image) upload ERROR!
- running function during post save and adding variable to post meta
- Should I change text-domain of TGM library inside theme?
- update_post_meta saves nothing in database when run in publish_post
- Can’t access post meta on new post creation (cpt)
- Custom post meta values reset by autosave [duplicate]
- Compare meta_query with a Regular Expression and do a less-than operation on it
- Easy export/import of data for Translation
- Is it possible to retrieve a post and its metadata at the same time?
- cleaning up safely wordpress wp_postmeta table
- Read post meta values, only if posts are public
- Post meta as array looks like string instead of array
- Why does get_transient() always return string even if integer set?
- Author_meta ONLY if it exists
- Time & Date on Post – Time Ago Custom Function
- How to test the outcome of a wpdb query?
- Mass removing CSS from 1,700 post [closed]
- Help with Post Meta
- Is there a way to disable post meta caching for development?
- /languages/ folder missing in default themes
- count post meta values
- Correct meta of Writing Meta Tags
- update_post_meta not working?
- Change wordpress meta tag description using WP functions
- Internationalize plugin so strings can be translated in WPML [closed]
- localization of theme and plugins to English (originally in another language)
- How to translate user added content in a plugin
- Cant create or update meta fields using WordPress REST API
- Filter posts by meta key
- Display current ranking of post as a number in post title
- delete duplicates wp_postmeta
- Post Thumbnail missing when using webp format while sharing
- How to merge the array values in foreach?
- Bulk Update Post Meta Values from Different Post via Rest Api
- Issue with translation – Gutenberg
- update_post_meta() is not saving the value
- Only show meta on one post type on search results page
- How to register post meta with multi level arrays?
- If I disable screen options, does WP still try to update post meta?
- update_post_meta not working with transition_comment_status
- Can we have duplicate key pair values in post meta data?
- I created a Custom Meta Box but it is not displaying the value on my post page
- Meta data being pulled from wp-login.php
- Attachment metadata has value of ‘1’
- Get post content before rendering
- wp_insert_post inside save_post adds wrong metadata to inserted post
- Rename image filename using ‘media_handle_upload’
- How do I update a specific value within array in a products metadata?
- Update Post metafield of specific categories
- Using Self Hosted Video URL With Custom Fields
- Multiple postmeta values to the same post_id/meta_key combination?
- get_post_meta not work in php foreach
- Restore deleted _thumbnail_id in postmeta table
- Why are my custom metaboxes not updating the post meta?
- Problem serializing single quote and double quote into post meta
- Storing post_meta fields in array
- Performace on 1 million plus meta fields vs 1 field with 1 million multi array
- Hide the_meta if no value
- Fetching array of postmeta with $wpdb and in_array conditional
- Piklist File Upload
- WordPress translation
- how to echo/display the custom field value in specific custom field name?
- update_post_meta() not working in bulk option
- How to update the ‘modified_time’ of a post ONLY when content is changed?
- Media library orphans
- Multiple If else statements on Search Result Page
- get_children filter with postmeta
- Auto save title as custom meta field value
- wordpress query making site very slow
- if condition from post_meta not working in save_post
- Extend file format support for post thumbnails