Related content with pages and posts

Hi Movin

I am using this following custom code on function.php which I found somewhere regarding to Jetpack related posts module developing and customization, and this plug in to add categories and tags to Pages.

The plug-in:

And the code:

function marce_allow_pages_for_relatedposts( $enabled )
{
if ( is_page() ) {
$enabled = true;
}
return $enabled;
}
add_filter( ‘jetpack_relatedposts_filter_enabled_for_request’, ‘marce_allow_pages_for_relatedposts’ );

Somehow now it only adds the pages to related content, but not the posts. What might be the reason? Is there something in that code that restricts the posts being mixed up with the related content? I would prefer both being interchangeable. Is the code making them separate? I only have one blog post so far so it won’t show others from post section and I was therefore expecting to see the related pages under the post…

I will send my website link in next message privately so you’ll see what I mean. Thank you.

Hi @kauno,

I hope you are well today and thank you for your question.

Does it work fine using default WordPress like Twenty Sixteen?

This seems related to plugins so you can contact Add Category to Pages plugin and Jetpack plugin authors regarding this.

Best Regards,
Movin

Thanks for the suggestion. What happens to my settings and Sparkling related widgets like Sparkling “popular posts widget” and Sparkling “social widget” etc. if I switch to other theme and then back to my Sparkling child theme with all these modifications I have done so far? Do everything remain intact or is there risk of loosing the theme specific modifications and ad-ons?

They will remain intact but in rare case the widgets will move in to Inactive Widgets section and you have to move them gain in respective sidebars.