Add Product Loop on 404 Page

Hi,

I try to add product loop on 404 page.

I have made a 404.php file in my child theme.
To add product loop I used this code:

<?php
the_widget( 'Leto_Product_Loop', 'leto' );
?>

It’s working well. But there appear 6 products in grid. I want to change it, to carousel. How can I achive this?

Thanks!

Hello there,

Try this code:

    $settings = array(
    	'mode' => 'best-seller-slider'	
    );
    the_widget( 'Leto_Product_Loop', $settings );

See the codex to know detailed use of the_widget function.

The widget’s instances can be seen in the below code block:

$title     		= isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
$includes       = isset( $instance['includes'] ) ? array_map( 'esc_attr', $instance['includes'] ) : '';
$number         = isset( $instance['number'] ) ? intval( $instance['number'] ) : 6;
$show_filter    = isset( $instance['show_filter'] ) ? (bool) $instance['show_filter'] : true;
$mode  			= isset( $instance['mode'] ) ? esc_attr( $instance['mode'] ) : 'grid';
$orderby  		= isset( $instance['orderby'] ) ? esc_attr( $instance['orderby'] ) : 'date';
$button_url		= isset( $instance['button_url'] ) ? esc_url( $instance['button_url'] ) : '';
$button_text	= isset( $instance['button_text'] ) ? esc_attr( $instance['button_text'] ) : '';

which was copied from the widgets/class-leto-product-loop.php file.

Regards,
Kharis

Thanks,

It’s working well.

You’re welcome!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis