Skip to content

Topic Hubs

New in 4.0.0. A topic hub turns a category or tag archive into a page about the topic: its description, the members writing about it, and their posts. It renders at /category/{slug}/ and /tag/{slug}/.

Element Notes
Topic name and description The term name and the description you set on the category or tag
Post count How many posts are in the topic
Writers on this topic The members publishing in it, ranked by how many posts they have in this topic (not site-wide)
Post grid The topic’s posts, paginated (12 per page by default)

The cards are the same cards used everywhere else in the plugin, so claps and bookmarks work on the hub.

Same rule as writer profiles, and for the same reason.

Situation Topic hub
Fresh install of 4.0.0 On.
Existing site upgrading from 3.x Off. The upgrade writes no explicitly.

A category archive is not a blank page. Themes style it, sites rely on it, and it lists posts this plugin knows nothing about. An existing site keeps the archives it already has, and its owner decides whether to hand them over.

The value is written once, at upgrade. Once you switch it on, it stays on.

Go to Member Blog > Content, find Topic hub, and choose:

  • Use the plugin’s topic hub - the plugin renders category and tag archives.
  • Leave category and tag archives to my theme - the theme’s category.php and tag.php render them, exactly as before.

Switching the takeover off does not remove the feature. You can still place [bp-member-blog-topic] on any page.

add_filter( 'bpmb_takeover_term_archive', '__return_false' );

The filter receives the setting’s value and the WP_Term being viewed, so you can take over some terms and not others:

// Hub for tags, theme archive for categories.
add_filter( 'bpmb_takeover_term_archive', function ( $takeover, $term ) {
return $takeover && 'post_tag' === $term->taxonomy;
}, 10, 2 );

By default, category and post_tag. Add your own:

add_filter( 'bpmb_topic_hub_taxonomies', function ( $taxonomies ) {
$taxonomies[] = 'genre';
return $taxonomies;
} );

Use these to put a hub on a normal page - a curated landing page for a topic you care about, rather than sending people to /category/....

[bp-member-blog-topic category="news"]
[bp-member-blog-topic tag="how-to" columns="2"]

There is also a Topic Hub block in the editor with the same options.

Attribute Default Description
category (empty) Category slug or ID
tag (empty) Tag slug or ID
per_page 12 Posts per page (maximum 24)
columns 3 Grid columns (1 to 4)
show_writers yes Show the “Writers on this topic” list
show_header yes Show the topic name, description and post count
class (empty) Extra CSS class on the wrapper

With no category and no tag, the shortcode uses the term of the archive it is placed on. On a page that is not a term archive it renders nothing.

Copy the hub template into your theme:

wp-content/themes/your-theme/buddypress-member-blog/topic-hub.php

Posts per page on the archive takeover is filterable:

add_filter( 'bpmb_topic_hub_per_page', function ( $per_page, $term ) {
return 24;
}, 10, 2 );