Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: bp_has_site_groups( \'type=most-forum-topics&max=6\') outside the director

@svenl77

Participant

Thanks a lo for your help, its working now.

I did it like this:

first I need to change the body class:

<?php
function new_body(){
return 'directory forums';
}
add_filter( 'body_class', 'new_body', 0, 2 );
?>

and then I need to modify the index.php from the forum directory.

with the modified version I can call the forum directory everywhere.

<?php include (STYLESHEETPATH . '/directories/forums/index.php'); ?>

<?php
global $site_groups_template;

$defaults = array(
'type' => 'type=most-forum-topics&max=6',
'per_page' => 10,
'max' => 6
);

$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );

// type: active ( default ) | random | newest | popular

if ( $max ) {
if ( $per_page > $max )
$per_page = $max;
}

$site_groups_template = new BP_Groups_Site_Groups_Template( $type, $per_page, $max );

?>

<?php if ( $site_groups_template->has_groups() ) : ?>

….

Skip to toolbar