- This topic has 6 replies, 2 voices, and was last updated 8 years, 3 months ago by Andrew Misplon.
- AuthorPosts
- September 8, 2016 at 6:48 pm #4803
rawnParticipantHello, how do I change the format for the date from D/m/y to m/d/y?
September 8, 2016 at 6:50 pm #4804
Andrew MisplonKeymasterHi rawn
Thanks for posting. It isn’t possible from within theme settings, it’ll take some custom development. Please, can you confirm which theme you’re using.
In the mean time, please, go to
Plugins > Add New
and install Code Snippets.September 8, 2016 at 6:54 pm #4805
rawnParticipantPuro Premium
September 8, 2016 at 6:58 pm #4806
Andrew MisplonKeymasterSuper. Thanks for your support. Once Code Snippets is activated, go to Snippets > Add New and create a new snippet, you can name it as you’d like. Insert the following in the snippet body:
if ( ! function_exists( 'puro_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time, author, comment count and categories. */ function puro_posted_on() { if ( is_sticky() && is_home() && ! is_paged() ) { echo '<span class="featured-post">' . __( 'Sticky', 'puro' ) . '</span>'; } if ( is_home() && siteorigin_setting('blog_post_date') || is_archive() && siteorigin_setting('blog_post_date') || is_search() && siteorigin_setting('blog_post_date') ) { echo '<span class="entry-date"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark"><time class="published" datetime="' . esc_attr( get_the_date( 'c' ) ) . '">' . esc_html( get_the_date( 'F j Y' ) ) . '</time><time class="updated" datetime="' . esc_attr( get_the_modified_date( 'c' ) ) . '">' . esc_html( get_the_modified_date() ) . '</time></span></a>'; } if ( is_single() && siteorigin_setting('blog_post_date') ) { echo '<span class="entry-date"><time class="published" datetime="' . esc_attr( get_the_date( 'c' ) ) . '">' . esc_html( get_the_date( 'F j Y' ) ) . '</time><time class="updated" datetime="' . esc_attr( get_the_modified_date( 'c' ) ) . '">' . esc_html( get_the_modified_date() ) . '</time></span>'; } if ( siteorigin_setting('blog_post_author') ) { echo '<span class="byline"><span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" rel="author">' . esc_html( get_the_author() ) . '</a></span></span>'; } if ( has_category() && siteorigin_setting('blog_post_cats') ) { echo '<span class="cat-links">' . get_the_category_list( __( ', ', 'puro' ) ) . '</span>'; } if ( has_tag() && siteorigin_setting('blog_post_tags') ) { echo '<span class="tags-links">' . get_the_tag_list( '', __( ', ', 'puro' ) ) . '</span>'; } if ( comments_open() && siteorigin_setting('blog_post_comment_count') ) { echo '<span class="comments-link">'; comments_popup_link( __( 'Leave a comment', 'puro' ), __( '1 Comment', 'puro' ), __( '% Comments', 'puro' ) ); echo '</span>'; } } endif;
Finally, NB: click the radio button to only run this snippet on the side front-end. Then, save changes and activate.
September 8, 2016 at 7:01 pm #4807
Andrew MisplonKeymasterFor a nicely formatted version of the snippet, please, see: http://pastebin.com/raw/sxB98Y5P.
September 8, 2016 at 7:10 pm #4808
rawnParticipantYou are the best! This one little thing kept me from using the theme for so long, any chance it can be added to the customizer in a future release?
September 8, 2016 at 7:12 pm #4809
Andrew MisplonKeymasterSuper 🙂 Really glad I could help out.
Sure, it’s been requested a few times so I can see there is a desire/demand to have control over the date output. I’ll log this as an enhancement request and investigate how to best implement it in an update soon.
- AuthorPosts
You must be logged in to reply to this topic.