Skip to:
Content
Pages
Categories
Search
Top
Bottom

Style logged in users posts/replies


  • brent0r
    Participant

    @brent0r

    Is there any way to style the logged in users replies?
    I’d like to change the background/border etc. the logged in users posts to help better distinguish ones own posts.
    Any tips or ideas on doing this would be greatly appreciated.
    Thank you.

Viewing 1 replies (of 1 total)

  • Robin W
    Moderator

    @robin-w

    ok, I worked out an easy way to do that

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/loop-single-reply.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/loop-single-reply.php
    bbPress will now use this template instead of the original
    and you can amend this

    so replace line 61 which reads

    <div class="bbp-reply-content">

    with

    <?php
    	//now check if it is the topic author
    		$author = bbp_get_reply_author_id(bbp_get_reply_id()) ;
    		$current_user = get_current_user_id() ;
    		if ($author == $current_user) {
    			echo '<div class="bbp-reply-content bbp-author">' ;
    		}
    		else echo '<div class="bbp-reply-content">' ;
    	?>
    

    then just add the bbp-author css styling to your theme’s custom css

    eg

    .bbp-author {
    background : green ;
    }

    you might require

    .bbp-author {
    background : green !important;
    }

    depending on where you put the css.

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