Hide/Edit Forum from Breadcrumb
-
Hi –
Rather than using the default ‘forum’ page to display my forum, I am embedding the forum on a custom static page using a shortcode.
I’d like to update the breadcrumbs and either hide (preferred) the default forum name/URL, or, edit the forum URL. I doubt I can edit the URL, so I’m okay with hiding the URL and manually injecting the URL in my functions.php file using the arg [‘before’]. Unfortunately, I don’t see a way to hide the specific Forum from the breadcrumbs. See possible arguments here: https://github.com/ntwb/bbPress/blob/master/src/includes/common/template.php#L2277-L2303
Out of the box:
Home (/) » Forums (/forums) » Forum Title (/forums/forum/forum-title/) » TopicIdeal:
Forum Title (/custom-page/) » TopicActual (based on code below):
Forum Title (/custom-page/) » Forum Title (/forums/forum/forum-title/) » TopicHere is the code I’m using to make that happen. Looking for a way to hide that second Forum Title.
function custom_bbp_breadcrumb() { $args['before'] ='<div class="bbp-breadcrumb"><p><a href="/custom-page/" class="bbp-breadcrumb-forum">Forum Title</a><span class="bbp-breadcrumb-sep"> » </span>'; $args['include_home'] = false; $args['include_root'] = false; return $args; } add_filter('bbp_before_get_breadcrumb_parse_args', 'custom_bbp_breadcrumb' );
- You must be logged in to reply to this topic.