Robkk (@robkk)

Forum Replies Created

Viewing 9 replies - 3,776 through 3,784 (of 3,784 total)

  • Robkk
    Moderator

    @robkk

    @netweb thanks for the reply
    i might do that function if i cant get the exact function im looking for

    i did find an example of a bbpress forum using exactly what i want though

    if you look at any other participant in the forum they do not have the topic author label

    so its exactly what im looking for.

    im trying to think of an idea of a function that would do that, but i have no idea how to make a function that does

    if topic author is the same as reply author display label above reply author avatar, or below forum role. IF not the same dont display anything.


    Robkk
    Moderator

    @robkk

    @robin-w hey thanks for helping me out

    and i was using 5 pages as an example

    i would like the topic starter label throughout a topic , for whatever number pages it may have

    so should i basically use this

    //This function adds the author to the reply
    function reply_display_author () {
    	if( get_post_type() == 'reply' ) {
    	echo '<span class="bbp-topic-started-by">' ;
    	printf( __( 'Topic started by: %1$s', 'bbpress' ), bbp_get_topic_author_link( array( 'size' => '14' ) )) ; 
    	echo '</span>' ;
    	}
    	else {
    	return ;
    	}
    	}
    add_action ('bbp_theme_before_reply_content', 'reply_display_author') ;

    with this function instead??

    <?php if ( bbp_thread_replies() ) : ?>
    
    			<?php bbp_list_replies(); ?>
    			
    			
    		<?php else : ?>
    			<?php global $countr ;
    			$countr=-1 ; ?>
    		
    			<?php while ( bbp_replies() ) : bbp_the_reply(); ?>
    			
    			<?php 
    			$countr ++ ;?>
    			
    			<?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
    
    			<?php endwhile; ?>
    			
    			
    		<?php endif; ?>

    Robkk
    Moderator

    @robkk

    Nevermind ill just remove the breadcrumbs from bbpress pages and style the bbpress breadcrumbs to be like my yoast ones


    Robkk
    Moderator

    @robkk

    Thank you this worked great


    Robkk
    Moderator

    @robkk

    forgot to mention the function im trying to change is in loop-single-reply.php


    Robkk
    Moderator

    @robkk

    This is what i used

    <div class="bbp-usr-location"><?php
    $bpProfileField = bp_get_profile_field_data( 'field=Location &user_id=' . get_the_author_meta( 'ID' ) );
    if ( empty ( $bpProfileField) ):
    ?>
    <p></p>
    <?php else: ?>
    <p><?php echo 'Location: ' . $bpProfileField; ?></p>
    <?php endif; ?></div>

    Robkk
    Moderator

    @robkk

    Nevermind i got it to work , plus that code i just posted is all out of wack , just some copy and pasting from other functions that worked


    Robkk
    Moderator

    @robkk

    @robin-w worked like a charm, thank you very much for the help!


    Robkk
    Moderator

    @robkk

    Yeah i have been using a child theme,

    I havent put every file from bbpress in my child theme

    Im just making small changes to the template files and only throw in the ones that i changed into my theme.

    And i use my themes custom css plugin for css changes.

    I really dont have anything to debug, i just have bits of php to try to make my desired function

    Like i know bbp_get_topic_freshness_link , shows the time ago of the last post

    And that <?php bbp_author_link( array( 'post_id' =>bbp_get_topic_last_active_id() gets ahold of the author of the last post in a topic

    <?php printf( __( 'Last Post: %1$s' lets me have my custom text with the attributes from the function

    I just dont know how to put that all together to get the function that i want

    Right now all in my function is

    <?php do_action( 'bbp_theme_before_topic_started_by' ); ?>
    
    <span class="bbp-last-post-by-author"><?php printf( __( 'Last Post: %1$s', 'bbpress' ),bbp_get_topic_freshness_link( array() ) ); ?></span>
    
    			<?php do_action( 'bbp_theme_after_topic_started_by' ); ?>
Viewing 9 replies - 3,776 through 3,784 (of 3,784 total)