#42715 Change number of related products output

Landing Forums JupiterX WordPress Theme Change number of related products output

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • mari.ti-04778676

    Hi,

    I am using a JupiterX theme and it is showing 5 related products bellow its description. My design is set to 4. I tried to use this suggestion to adjust it to 4 products, unsuccessfully: https://themes.artbees.net/docs/related-products/.

    Amir Rather Support Team

    By default, Jupiter X doesn’t have the option to change the number of related/recommended posts inside the single posts pages. It will calculate the number of related posts based on the layout you chose. 3 related posts for when you have one sidebar, and 2 related posts for when you have two sidebars. Also, 4 posts for when you don’t have any sidebar (full width).

    However, You can easily change that number by adding this snippet to your child theme’s functions.php file:

    add_filter( 'jupiterx_post_related_count', function() {
    $post_count = [
    'posts_per_page' => 2,
    'columns' => 6,
    ];
    
    return $post_count;
    } );

    The columns value inside the $post_count array is the number of Grid columns. So, setting it as 6, will actually give you two columns. (number of grid cells is 12)

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Login