Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter sumonbdinfo

    (@sumonbdinfo)

    Is there anyone who can help me?

    Woocommerce widget products categories will help you.
    It is in Widgets menu

    Thread Starter sumonbdinfo

    (@sumonbdinfo)

    HI,
    Thank you for reply me. But, I don’t want to show it with Widget. I want to show it into a page. How may I able to do that?

    sumonbdinfo,
    this should work for you
    <?php echo do_shortcode('[products orderby="category" order="desc"]') ?>
    or
    `<?php
    $args=array(
    ‘post_type’ => ‘products’,
    ‘orderby’ => “category”,
    ‘order’ => ASC,
    ‘caller_get_posts’=> 1
    );
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
    echo ” . $type .”;
    while ($my_query->have_posts()) : $my_query->the_post(); ?>

    <ul>
    <li><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></a></li>
    <li><?php the_excerpt() ?></li>
    </ul>
    <?php
    endwhile;
    } //if ($my_query)
    wp_reset_query(); // Restore global post data stomped by the_post().
    ?>`
    the first example is off of woocommerce site. The second way you will have more control over how things display you can also call in the thumbnail by using by <?php the_post_thumbnail(); ?> You will want to set the size of the thumbnail to fit what you are looking for.

    Hope this helps

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to show all of Woocommerce Product Categories in a single page?’ is closed to new replies.