404 page showing Random products
-
Ok as asked in previous post to start a new post..
i was kindly given this code to display random products in my 404 page
<ul class="products"> <?php $args = array( 'post_type' => 'product', //don't change 'posts_per_page' => 12, //change to number of posts you want to display 'orderby' => 'rand' ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { while ( $loop->have_posts() ) : $loop->the_post(); woocommerce_get_template_part( 'content', 'product' ); endwhile; } else { echo __( 'No products found' ); } wp_reset_postdata(); ?> </ul><!--/.products-->
This also displays the Product Short Description here as well.
is there anyway to remove the wording that has been put in the Product Short Description part of the Product page and just have the image and other data there.
Like a “dont add the Product Short Description’ part as well??thanks
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘404 page showing Random products’ is closed to new replies.