BuddyBoss Home – Web › Support Forums › Solutions › Social Learner › Last Modified instead publish date on blog post and lesson
- This topic has 5 replies, 3 contibutors, and was last updated 8 years, 8 months ago by Anonymous.
Question
February 29, 2016 at 5:24 pm #60821@peppe-sapienzaHi,
There is a way to show Last Modified date instead the publish date?
Answers
March 1, 2016 at 4:32 am #60871@peppe-sapienza@vapvarun can you help me?
I think this could be a nice feature for boss theme
March 1, 2016 at 4:54 am #60875@
AnonymousIt can be easily modified inside the single.php
add following function inside child theme functions.php
function buddyboss_entry_meta_modified( $show_author = true, $show_date = true, $show_comment_info = true ) { // Translators: used between list items, there is a space after the comma. $categories_list = get_the_category_list( __( ', ', 'boss' ) ); // Translators: used between list items, there is a space after the comma. $tag_list = get_the_tag_list( '', __( ', ', 'boss' ) ); $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark" class="post-date fa fa-clock-o"><time class="entry-date" datetime="%3$s">%4$s</time></a>', esc_url( get_permalink() ), esc_attr( get_the_modified_time() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'boss' ), get_the_author() ) ), get_the_author() ); if ( function_exists( 'get_avatar' ) ) { $avatar = sprintf( '<a href="%1$s" rel="bookmark">%2$s</a>', esc_url( get_permalink() ), get_avatar( get_the_author_meta( 'email' ), 55 ) ); } if ( $show_author ) { echo '<span class="post-author">'; echo $avatar; echo $author; echo '</span>'; } if ( $show_date ) { echo $date; } if ( $show_comment_info ) { if ( comments_open() ) : ?> <!-- reply link --> <span class="comments-link fa fa-comment-o"> <?php comments_popup_link( '<span class="leave-reply">' . __( '0 comments', 'boss' ) . '</span>', __( '1 comment', 'boss' ), __( '% comments', 'boss' ) ); ?> </span><!-- .comments-link --> <?php endif; // comments_open() } }
copy single.php inside the child theme and replace line 24 inside /boss-child/single.php
<?php buddyboss_entry_meta(); ?>
with
<?php buddyboss_entry_meta_modified(); ?>
Regards
March 1, 2016 at 4:59 am #60877@
AnonymousHi @peppe-sapienza
Above will work for blog post and for lesson it will need edits inside the boss-sensei template file.Boss-Sensei template files are in revamp process, please wait for next update to get it stable
Then i will guide you on this also
to make these edits
get_the_date() -replaced with- get_the_modified_date()
get_the_time() -replaced with- the_modified_time()Regards
Varun DubeyMarch 1, 2016 at 5:36 am #60891@peppe-sapienzaSo it’s better wait the new update before do this change?
March 3, 2016 at 2:11 am #61226@
AnonymousHi @peppe-sapienza, It was the quick fix what you need currently with Last Modified date. I will discuss about it to add this feature in our theme as well.
Regards
- The question ‘Last Modified instead publish date on blog post and lesson’ is closed to new replies.