hmm… that’s not easy as you rightly say the hierarchy is
content-archive-topic
loop-topics
loop-single-topic
This last one is also used by forums, so you can’t just change that.
In this last you could hook an action to ‘bbp_theme_before_topic_title’ eg put this in your child theme functions file
add_action ('bbp_theme_before_topic_title' ,'rew_display_forum' ) ;
function rew_display_forum () {
$topic_forum_id = bbp_get_topic_forum_id();
$forum_title = bbp_get_forum_title( $topic_forum_id);
echo '<div class="rew-forum-name">'.$forum_title.'</div>' ;
}
and then as the shortcode displays in a ‘page’ class and the forums in a ‘forum’ class, we can add css to hide the forum title unless we are in a page
so in your custom css area put
.rew-forum-name {
display :none ;
}
.page .rew-forum-name {
display : inline-block ;
}
that should work
Thanks for the answer!
Is working well but… Can I put the “link” on the forum name? So if I click it goes to the forum.
Regards.
Adrià Calendario.
add_action ('bbp_theme_before_topic_title' ,'rew_display_forum' ) ;
function rew_display_forum () {
$topic_forum_id = bbp_get_topic_forum_id();
$forum_title = bbp_get_forum_title( $topic_forum_id);
$forum_url = bbp_get_forum_permalink( $topic_forum_id );
echo '<a class="rew-forum-name" href="'.$forum_url.'">'.$forum_title.': </a>' ;
}
WOW!
Thank you for the support!
I am going to donate you right now. For sure.
Regards.
Adrià Calendario.
Thank you so much for your kind donation – it is really appreciated !!
I am glad to have helped 🙂