• Resolved Cris

    (@crispaor)


    Hi,
    I have a function to disable “Related Posts” from appearing on specific posts and I would like this worked to all EDD downloads both.
    If I use an especific ID, this work well but, how can to do this to all IDs EDD and not add it 1 to 1 ID?

    The function is:
    function jetpackme_no_related_posts( $options ) {
    if ( is_single( array( 2510 ) ) ) {
    $options[‘enabled’] = false;
    }
    return $options;
    }
    add_filter( ‘jetpack_relatedposts_filter_options’, ‘jetpackme_no_related_posts’ );

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @crispaor

    As per your recent code, I have slightly modified it. You can use the below code snippet for all products of EDD.

    function jetpackme_no_related_posts( $options ) {
    	if ( is_singular( 'download' ) ) {
    		$options['enabled'] = false;
    	}
    	return $options;
    }
    add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_no_related_posts' );
    Thread Starter Cris

    (@crispaor)

    Perfect!!
    Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘All IDs’ is closed to new replies.