I’m using this code:
<?php if ( $topics ) : foreach ( $topics as $topic ) : ?>
<?php if( $topic->forum_id != 29 && $topic->forum_id != 30 && $topic->forum_id != 18 && $topic->forum_id != 15 && $topic->forum_id != 4 ) { //exclude forums here ?>
<tr<?php topic_class(); ?>>
If you’re using the Kakumei theme, replace this with that:
<?php if ( $topics ) : foreach ( $topics as $topic ) : ?>
<tr<?php topic_class(); ?>>
Just change the id’s
Hi Chandersbs,
i am sorry i didnt get what i should do: should i edit only this part
{ //exclude forums here ?>
and fill it with the id of the forum i want to exclude?
Or should i change the ids in the following line? I only have 1 forum to exclude, and its “position” is 4, does that mean that its id is 4 as well?
<?php if( $topic->forum_id != 29 && $topic->forum_id != 30 && $topic->forum_id != 18 && $topic->forum_id != 15 && $topic->forum_id != 4 )
Thanks!
The Process
This might be a cleaner solution
<?php
switch ( $topic->forum_id ) { // Ignore these forums
case 29:
case 30:
case 18:
case 15:
case 4:
continue 2;
}
?>
or for including only certain forums
switch ( $topic->forum_id ) { // Include only these forums
case 29:
case 30:
case 18:
case 15:
case 4:
break;
default:
continue 2;
}
?>
but using that if statement, you need to change the line
<?php if( $topic->forum_id != 29 && $topic->forum_id != 30 && $topic->forum_id != 18 && $topic->forum_id != 15 && $topic->forum_id != 4 )
and you can find the forum ID from looking at its Edit URL in the admin panel (under Forums)