H
H
hypero2018-05-15 15:13:29
WordPress
hypero, 2018-05-15 15:13:29

How to display similar products in one row of 4 products?

Hello.
Such a problem.
Now the block "Perhaps you will also be interested in ..." is displayed in 2 rows.
Is it necessary to display 4 products in the same row only? How to implement it?5afacedde256a021392180.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2018-05-17
@Alex-Woo

add the following code to functions.php:

add_filter( 'woocommerce_output_related_products_args', 'change_number_of_related_products' );

function change_number_of_related_products( $args ) {
  $args['posts_per_page'] = 3; // количество выводимых похожих товаров
  $args['columns']        = 3;    // количесто столбцов
  return $args;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question