BuddyBoss Home – Web Support Forums Themes BuddyBoss theme Author WP vs Author BP

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

    #41101
    @romanusaev

    Hello!

    How i can change link from Author WP to Author Buddypress in wp blog posts ?

    Answers

    #41128

    Alyssa
    Participant
    @alyssa-buddyboss

    @romanusaev There are a few things you need to do first is copy content.php from the parent theme into your child theme. Then edit line 23 from this:
    buddyboss_entry_meta();
    to this:
    buddyboss_alt_entry_meta();
    Then you need to add this to your functions.php file of your child theme:

    function buddyboss_alt_entry_meta(){
    	// Translators: used between list items, there is a space after the comma.
    	$categories_list = get_the_category_list( __( ', ', 'buddyboss' ) );
    
    	// Translators: used between list items, there is a space after the comma.
    	$tag_list = get_the_tag_list( '', __( ', ', 'buddyboss' ) );
    
    	$date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a>',
    		esc_url( get_permalink() ),
    		esc_attr( get_the_time() ),
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_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', 'buddyboss' ), get_the_author() ) ),
    		get_the_author()
    	);
    
    	// Translators: 3 is the date and 4 is the author's name.
    	if ( $tag_list ) {
    		$utility_text = __( '%3$s <span class="by-author"> by %4$s</span>', 'buddyboss' );
    	} elseif ( $categories_list ) {
    		$utility_text = __( '%3$s <span class="by-author"> by %4$s</span>', 'buddyboss' );
    	} else {
    		$utility_text = __( '%3$s <span class="by-author"> by %4$s</span>', 'buddyboss' );
    	}
    
    	printf(
    		$utility_text,
    		$categories_list,
    		$tag_list,
    		$date,
    		$author
    	);
    }

    Then edit the author data in the above code

Viewing 2 posts - 1 through 2 (of 2 total)
  • The question ‘Author WP vs Author BP’ is closed to new replies.