Update docs/snippets/number-of-products-per-row.md

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
This commit is contained in:
Niels Lange 2023-07-18 15:57:26 +02:00 committed by GitHub
parent 53926dcf64
commit 96a1e39902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -15,6 +15,9 @@ if ( ! function_exists( 'YOUR_PREFIX_related_products_args' ) ) {
* @return array The modified related products args.
*/
function YOUR_PREFIX_related_products_args( $args ) {
If ( ! is_array( $args ) ) {
$args = array();
}
$args['posts_per_page'] = 4; // 4 related products.
$args['columns'] = 2; // Arranged in 2 columns.
return $args;