You can stop nrelate from showing on a particular post or page, using standard WordPress conditionals (for a full list click here)
Single Post
To remove one or more POSTS, add the following code to your theme’s functions.php file. (for Pages, change “is_single” to “is_page”):
function hide_nrelate_from_posts($load_nrelate) {
if ( is_single("post-id-here") ) {
$load_nrelate = false;
}
return $load_nrelate;
}
add_filter('nrelate_related_is_loading', 'hide_nrelate_from_posts');
You need to change “post-id-here” to the ID of the post or page you want to target. So if you want to target Post “17″, use this:
function hide_nrelate_from_posts($load_nrelate) {
if ( is_single('17') ) {
$load_nrelate = false;
}
return $load_nrelate;
}
add_filter('nrelate_related_is_loading', 'hide_nrelate_from_posts');
Multiple Posts
You can also target more than one Post. Let’s say you want to remove nrelate from Post’s 17,18 and 19. You would wrap them in an array, which looks like this:
function hide_nrelate_from_posts($load_nrelate) {
if ( is_single(array('17','18','19')) ) {
$load_nrelate = false;
}
return $load_nrelate;
}
add_filter('nrelate_related_is_loading', 'hide_nrelate_from_posts');
Post in a Category
To remove nRelate from a post in a particular category, find the category ID (here’s how) and use the in_category conditional. Let’s say you want to hide nRelate from any posts in category 6:
function hide_nrelate_from_cat($load_nrelate) {
if ( in_category('6') ) {
$load_nrelate = false;
}
return $load_nrelate;
}
add_filter('nrelate_related_is_loading', 'hide_nrelate_from_cat');
Posts from multiple Categories
You can also remove nRelate from posts in multiple categories. To hide nRelate from any posts in categories 6, 7 and 8 try this:
function hide_nrelate_from_cat($load_nrelate) {
if ( in_category( array( 6,7,8 )) ) {
$load_nrelate = false;
}
return $load_nrelate;
}
add_filter('nrelate_related_is_loading', 'hide_nrelate_from_cat');
For MOST POPULAR replace:
nrelate_related_is_loading
with
nrelate_popular_is_loading
For FLYOUT replace:
nrelate_related_is_loading
with
nrelate_flyout_is_loading