BuddyBoss Home – Web Support Forums Solutions Social Learner Last Modified instead publish date on blog post and lesson

Viewing 6 posts - 1 through 6 (of 6 total)
  • Question

    #60821
    @peppe-sapienza

    Hi,

    There is a way to show Last Modified date instead the publish date?

    Answers

    #60871
    @peppe-sapienza

    @vapvarun can you help me?

    I think this could be a nice feature for boss theme

    #60875

    Anonymous
    @

    It 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

    #60877

    Anonymous
    @

    Hi @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 Dubey

    #60891
    @peppe-sapienza

    So it’s better wait the new update before do this change?

    #61226

    Anonymous
    @

    Hi @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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The question ‘Last Modified instead publish date on blog post and lesson’ is closed to new replies.