How to exclude forum post_type within functions.php?
-
Hi,
I’m trying to exclude all forum post types within my main WordPress theme’s functions.php file using this sort of syntax:
$post_type != 'forum'
However it doesn’t seem to work. Here is the full if statement I’m using:
function single_post_nav() {
if ( is_single() && !in_category(array('54', '55', '56', '57', '58')) && !is_category(array('54', '55', '56', '57', '58')) && $post_type != 'forum' ) { ?>
Some stuffHowever, it is still displaying the content on forum pages. Does anyone know the correct way to exclude the forum posts within functions.php?
Any help much appreciated.
Cheers – Ben
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.