• Marcus posted an update 6 months, 1 week ago

    Here is a quick wordpress hack for you guys.
    If you want to just add your own classes to WordPress functions then look no further!
    Here is an example of how you can add your own extra class to an echo’ed buddypress user avatar used in the message loop EASILY.

    bp_message_thread_avatar( array( ‘class’ => avatar1 ) );

    This code will add the class “avatar1” to the avatar and you can also set the height and width to what you want to.

    You can use this on any wordpress functions you like aslong as the function accepts the class argument such as user avatars.

    If you want to add more than one class then the easiest way to do this is to append another one and add a space before it.

    bp_message_thread_avatar( array( ‘class’ => ‘avatar1′.’ plop’, ‘width’ => 42, ‘height’ => 42 ) );

    This allow for better customization. I hope this hack helps someone because before I knew this I just was settling with wrapping the function within a custom div or editing wordpress divs using css wich isnt the best way.