Jetpack Tricks

Jetpack is a useful and afordable plugin for WordPress website created by Automattic. Best of all, it has a free plan, with such generous features such as unlimited static images hosting, downtime monitoring, stats, related contents, and so much more. It has a paid plan that offers many great features such as video hosting without ads.

Here I want to share some Jetpack tricks that I know and use to customize your WordPress and WooCommerce site.

Change Related Posts Amount

/**
 * Change Related Posts Items
 */
function jetpackme_more_related_posts( $options ) {
    $options['size'] = 6;
    return $options;
}
add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_more_related_posts' );

Change the value of $options['size'] to any number you want. And that’s all.

Removing Related Posts on WooCommerce Products

/**
 * Hide Related Posts on WooCommerce Products
 */
function jetpackme_hide_related_posts_on_products( $options ) {
    if ( is_product() ) {
        $options['enabled'] = false;
    }
    return $options;
}
add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_hide_related_posts_on_products' );

Sometime you don’t want the related posts content showing on WooCommerce products. Add the code above and you are good.

Questions?

Where do you put these code? Put the code in your functions.php inside the main folder of your theme. If you are not comfortable changing code, please ask for some WordPress experts.

Leave a comment

Your email address will not be published. Required fields are marked *