Update August 5, 2015: Certain information I have here has been changed and updated in a subsequent post about Jetpack Related Posts entitled “Why you may have been having problems removing Jetpack Related Posts from specific posts [contd]”. Please read it dfor the latest information on the topic.
Today I found out that a CSS customization I had made to Jetpack Related Posts didn’t take after all. The reason why related posts didn’t appear at first was because the plugin hadn’t found any appropriate related posts yet! I had checked previously to see if the customization I wanted to make was available on Jetpack Support, but it wasn’t. What I am trying to do is remove Jetpack Related Posts from certain post formats. For now, it would only be for the Quotes post format. I tried to work around this by creating a Quotes category so that I could remove Related Posts from that category. I haven’t managed to figure that one out yet. Perhaps the 2013 theme might shed some light? But meanwhile, today I added the code provided by Jetpack Support to “Remove Jetpack Related Posts from Specific Posts”to my functions.php file, and it didn’t work. This is the code that appears on Jetpack Support:
1 2 3 4 5 6 7 |
function jetpackme_no_related_posts( $options ) { if ( is_single( array( 17, 19, 1, 11 ) ) ) { $options['enabled'] = false; } return $options; } add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_no_related_posts' ); |
This is what I came up with:
1 2 3 4 5 6 7 |
function jetpackme_no_relatedposts( $options ) { if ( is_single( array(378, 397, 434 ) ) ) { $options['enabled'] = false; } return $options; } add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_no_relatedposts'); |
Notice the difference?
I submitted this issue to Auttomatic on Github today. Hope this helps those who were having problems disabling Jetpack Related Posts from specific posts.
This is what a Quote post format looks like now on this site:
Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please. Comments are moderated, so spammy or malicious links will be removed.