Customize inbox template
I would like to customize the template of the inbox. The standard is, that just the subject line of a personal message is linked with the fitting message-thread.
I would like to link the excerpt of the message with the message-thread too.
Also I would like to add a hyperlink to users avater in the inbox. It should direct to the users profile.
Any ideas how I can solve this?
Thanks a lot.
Hi @datenfresser – You can customize the template by overriding the template file in your child theme. Copy the file
wp-content/themes/[your-theme]/buddypress/members/single/messages/messages-loop.php, and make your modifications to the new file.
To turn avatars into links, find lines that look like:
<?php bp_message_thread_avatar( array( 'width' => 25, 'height' => 25 ) ); ?>
and do this:
<a href="<?php bp_message_thread_from(); ?><php bp_message_thread_avatar( array( 'width' => 25, 'height' => 25 ) ); ?></a>
Something like that should get you close to what you want.
To link the excerpt, find the line that includes
bp_message_thread_excerpt(), and wrap it in a link to
bp_message_thread_view_link(). See the ‘View Message’ markup just above for a template you can copy.
thank you so much. Your solution works for me.
Best wishes from Berlin
Me again. I’ve another problem. If a user clicks on a personal message in the message-loop, he is directed to his profile. Its not very comfortable (especially on mobile devices) that he has to scroll over his cover picture to reach the message.
So I would like to add an anchor-tag above the thread title in the single view of an thread.
Can somebody let me know which files I need to customize (and in which way)?
This picture tries to demonstrate what I would like to do:
- You must be logged in to reply to this topic.