bbp_is_forum_archive()

Check if we are viewing a forum archive.

Description

Return

(bool)

Source

File: bp-forums/common/template.php

function bbp_is_forum_archive() {
	global $wp_query;

	// Default to false
	$retval = false;

	// In forum archive
	if ( is_post_type_archive( bbp_get_forum_post_type() ) || bbp_is_query_name( 'bbp_forum_archive' ) || !empty( $wp_query->bbp_show_topics_on_root ) || absint( $wp_query->get( 'page_id' ) ) === (int) bp_get_option('_bbp_root_slug_custom_slug') )
		$retval = true;

	return (bool) apply_filters( 'bbp_is_forum_archive', $retval );
}

Changelog

Changelog
Version Description
bbPress (r3251) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.