• Resolved nhtvpostma

    (@nhtvpostma)


    Dear Ajay,

    The feature “Exclude display of related posts on these posts / pages” does not work. We have manually inserted the code into the template.

    Please help quickly as the reason I need this is that a student of ours has died. I don’t want the ‘happy related stuff’ below this sad news.

    Thank you,
    Steven

    http://wordpress.org/plugins/contextual-related-posts/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter nhtvpostma

    (@nhtvpostma)

    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!

    Thread Starter nhtvpostma

    (@nhtvpostma)

    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();
    }
    Thread Starter nhtvpostma

    (@nhtvpostma)

    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?

    Thread Starter nhtvpostma

    (@nhtvpostma)

    Hi Ajay,

    Are you in a position to share this code in case others find it useful?

    Sorry, no I am not.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Exclude display related posts not working’ is closed to new replies.