Custom Slider Looper

I have a custom looper below. I am testing to make sure I do this right so i am aware you can build a query for products another way. This is just the base to refine the query.

I added a slider elemnt. made the slide a looper with custom: crosssell . and Consumer to all.

It shows nothing. Did i set this up right? How do i make the slider show all products by using a custom looper function only? (I will be adding other args to the looper after i get it to show all products first. )

add_filter(‘cs_looper_custom_crosssell’, function($result, $args) {

$args = array(
‘post_type’ => ‘product’,
‘posts_per_page’ => -1
$products = new WP_Query( $args );
return $products;
}, 10, 2);

Hello @allcal,

Thanks for writing in!

Please update this line:
$products = new WP_Query( $args );

and change it to:
$products = get_posts( $args );

Be advised that custom coding is beyond the scope of our support under our Support Policy. If you are unfamiliar with code and resolving potential conflicts, you may select our One service for further assistance.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.