Related posts should not be in LearnDash lessons and topics. Could you disable them for LearnDash courses?
Related posts should not be in LearnDash lessons and topics. Could you disable them for LearnDash courses?
Those Related Posts were enabled from within the LearnDash plugin. You can disable them using filters, like so:
https://jetpack.com/support/related-posts/customize-related-posts/#disable
@jeherve
Thanks for your response!
Maybe in future you will add more intuitive UI to selecting post types for related posts? Something with checkboxes and description.
Maybe in future you will add more intuitive UI to selecting post types for related posts? Something with checkboxes and description.
Yes, I agree it could be a nice improvement. That's something we're tracking here: #10067
@jeherve
I disabled related posts in WooCommerce products with using your example and function is_product(). But how can I identify LearnDash lesson page? Could you give some example?
I believe LearnDash uses the sfwd-lessons and sfwd-courses Custom Post Types. You could try targetting both like so: is_singular( array( 'sfwd-lessons', 'sfwd-courses' ) ).
@jeherve
Thanks!
Here is my code:
function jetpackme_exclude_jetpack_related_from_learndash( $options ) {
if ( is_singular( array( 'sfwd-courses', 'sfwd-lessons', 'sfwd-quiz', 'sfwd-topic', 'sfwd-certificates' ) ) ) {
$options['enabled'] = false;
}
return $options;
}
add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_exclude_jetpack_related_from_learndash' );
If you wish you can add it to docs page