Filter the Enabled value to allow related posts to be selectively enabled/disabled.
Parameters
- $enabled
bool Should Related Posts be enabled on the current page.
Changelog
- Introduced in Jetpack 3.3.0
How to use this hook
Notes
Related Posts aren’t enabled on Pages by default. You can, however, use this filter to change that. Here is how to use it:
function jeherve_allow_pages_for_relatedposts( $enabled ) {
if ( is_page() ) {
$enabled = true;
}
return $enabled;
}
add_filter( 'jetpack_relatedposts_filter_enabled_for_request', 'jeherve_allow_pages_for_relatedposts' );