Skip to content

Filter: bricks/database/content_type

Filters the content type determined by Bricks for the current page request. This affects which template conditions are checked (e.g., whether to look for a single template, archive template, or search results template).

  • $content_type (string): The detected content type (e.g., content, archive, search, error, header, footer).
  • $post_id (int): The current post ID.
add_filter( 'bricks/database/content_type', function( $content_type, $post_id ) {
// Example: Treat a specific page as a search results page
if ( is_page( 'advanced-search' ) ) {
return 'search';
}
return $content_type;
}, 10, 2 );