Hide related posts on multiple pages
-
Hello, I’d like to add the Related posts feature on multiple pages (not posts)
I used this code to show the feature on pages:
function jetpackme_allow_pages_for_relatedposts( $enabled ) { if ( is_page() ) { $enabled = true; } return $enabled; } add_filter( 'jetpack_relatedposts_filter_enabled_for_request', 'jetpackme_allow_pages_for_relatedposts' );And it worked for all pages. Now I would like to remove it for specific ones.
The code suggested on the support website is:
function jetpackme_no_related_posts_onpages( $options ) { if ( is_page( 11 ) ) { $options['enabled'] = false; } return $options; } add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_no_related_posts_onpages' );But this only works on one page, i tried modifying it but with my restricted programming knoledge i could not make it do what I wanted
I also tried using this one, based on the code suggested on the support website to hide the feature on multiple posts:
function jetpackme_no_related_posts_onpages( $options ) { if ( is_single( array( 547, 2384 ) ) ) { $options['enabled'] = false; } return $options; } add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_no_related_posts_onpages' );But it didnt work either.
So is it possible to remove the feature on multiple pages?
Thank you
The topic ‘Hide related posts on multiple pages’ is closed to new replies.