The problem is the manual install code. It doesn’t check for exclusion of related posts on the post id itself.
So change:
<?php if(function_exists('echo_ald_crp')) echo_ald_crp(); ?>
to this:
<?php
$exclude_on_post_ids = explode(',',$crp_settings['exclude_on_post_ids']);
if (in_array($post->ID, $exclude_on_post_ids)) {
echo('');
}
else {
if(function_exists('echo_ald_crp')) echo_ald_crp();
}
?>
And now the check is done before echoing CRP.
Hope this helps more people.
I’m a php-noob, so please comment if i’ve done something wrong!
Scratch that. I think I’ve got it backwards.
So once again. Please help
Plugin Author
Ajay
(@ajay)
Apologies for the delay in replying.
You just need to add this post ID in “Exclude display of related posts on these posts / pages”.
Are you saying that this option isn’t working because you’re using the manual install?
You could try this code:
if(function_exists('echo_ald_crp')) {
global $crp_settings,$post;
$exclude_on_post_ids = explode(',',$crp_settings['exclude_on_post_ids']);
if (!in_array($post->ID, $exclude_on_post_ids)) echo_ald_crp();
}
Hi Ajay,
You just need to add this post ID in “Exclude display of related posts on these posts / pages”.
Yes this option does not work with manual install.
I don’t need to try the code any more. I’ve had someone create some code so I can exclude the Related Posts with a custom field.
Thanks for the help
Steven
Plugin Author
Ajay
(@ajay)
Steven,
Are you in a position to share this code in case others find it useful?