WooCommerce - excelling eCommerce
WP loop in WooComerce theme (archive-product.php) (1 post)

  1. BogdanChebac
    Posted 1 year ago #

    Basically I want to make a WP loop for the Woocommerce products in archive-product.php

    This being an example:

    $args = array(
        'post_type' => 'product',
        'posts_per_page' => 10,
        'orderby' => 'date',
        'order' => 'desc'
    $loop = new WP_Query( $args );
    if ( $loop->have_posts() ) {
        while ( $loop->have_posts() ) : $loop->the_post(); ?>
        <a href="<?php echo get_permalink( $loop->post->ID ) ?>"><?php the_title(); ?></a>
        <?php   endwhile;
        } else { echo __( 'No products found' ); }

    But it doesn't seem to display anything and even makes the page go blank when I try to access said page.

    My question is if I can modify this loop easily to do what I want or even better if I can make all the Woocommerce category pages go to the category.php of the standard WP themes (since I have an easier time editing that to my liking )

    Thank you in advance for your answers and time :)


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic