Skip to:
Content
Pages
Categories
Search
Top
Bottom

ADD custom HTML in keymaster reply


  • sajjad
    Participant

    @sajjad203

    Hi. i want to add custom html under the keymaster’s name in his reply.
    My html is: <p class="supportteam">I im in supporting group</p>

    I have all bbpress’s files in my theme and think that the loop-single-reply.php should be modify but can’t find the correct solution to do it.
    Here is my purpose: http://i.cubeupload.com/ZSr3pR.png
    my loop-single-reply.php :

    <div id="post-<?php bbp_reply_id(); ?>" <?php bbp_reply_class(); ?>>
    	<div class="bbp-reply-author">
    		<?php do_action( 'bbp_theme_before_reply_author_details' ); ?>
    		<?php bbp_reply_author_link( array( 'type' => 'avatar', 'show_role' => false ) ); ?>
    		<?php do_action( 'bbp_theme_after_reply_author_details' ); ?>
    	</div><!-- .bbp-reply-author -->
        <div class="bbp-meta">  
        <?php bbp_reply_author_link( array( 'type' => 'name', 'show_role' => false ) ); ?>   
        " title="<?php bbp_reply_title(); ?>" class="bbp-reply-permalink"><span class="bbp-reply-post-date"><?php bbp_reply_post_date(); ?></span>
       <!--HERE IS a place for my new code -->
        </div>
    	<div class="bbp-reply-content">
    		<?php do_action( 'bbp_theme_before_reply_content' ); ?>
    		<?php bbp_reply_content(); ?>
    		<?php do_action( 'bbp_theme_after_reply_content' ); ?>
    	</div><!-- .bbp-reply-content -->
        <?php do_action( 'bbp_theme_before_reply_admin_links' ); ?>
    		<?php 
    		$args = array (
    			'id'     => 0,
    			'before' => '<span class="bbp-admin-links">',
    			'after'  => '</span>',
    			'sep'    => ' / ',
    			'links'  => array()
    		);
    		bbp_reply_admin_links( $args ); ?>
    		<?php do_action( 'bbp_theme_after_reply_admin_links' ); ?>
    </div><!-- #post-<?php bbp_reply_id(); ?> -->

    I tried this code but it does not work:


    <?php
    $role=bbp_get_reply_author_role();
    if($role == 'keymaster'){echo '<p class=="supportteam">I im in supporting group</p>';}
    ?>

    It not show anythings!
    Can you help me to correct this code?
    When i use this:

    $role=bbp_get_reply_author_role();
    echo $role;

    it print reply author’s role.

Viewing 10 replies - 1 through 10 (of 10 total)

  • sajjad
    Participant

    @sajjad203

    Can anyone help me to correct this code?
    Thanks a lot


    sajjad
    Participant

    @sajjad203

    UP!


    sajjad
    Participant

    @sajjad203

    Any reply yet!!!
    I have request to help me to correct this code. I am not expert in php.
    Thank you to all …


    sajjad
    Participant

    @sajjad203

    I am wondered!!! After 4 days any reply to me!!!


    makonvict
    Participant

    @makonvict

    Whats So Weird Here To Be Wondered?


    sajjad
    Participant

    @sajjad203

    Please reply to my question if can.
    Thanks


    Robin W
    Moderator

    @robin-w

    ok, sorry for delay – putting in ‘bumps’ tends to not get you help as many of us work on ‘topics with no replies’ and you have replies 🙂

    Put the following in your functions file

    function rew_role_show () {
    $displayed_user = bbp_get_reply_author_id() ;
    $role = bbp_get_user_role( $displayed_user);
    if ( bbp_is_user_keymaster($displayed_user) ||$role == 'bbp_moderator')  {
    echo '<li>' ; 
    echo 'I im in supporting group';
    echo '</li>' ;
    }
    }
    
    add_action ('bbp_theme_after_reply_author_details', 'rew_role_show') ;
    	
    

    Functions files and child themes – explained !


    Robin W
    Moderator

    @robin-w

    That does the display for both keymasters and moderators


    sajjad
    Participant

    @sajjad203

    Thank you very muchhhhhhhhhhhhhhhhhh 🙂


    Robin W
    Moderator

    @robin-w

    no problem – glad you’re fixed !

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Skip to toolbar