[Support request] categories side by side on store page (woocommerce)

Home Forums Support categories side by side on store page (woocommerce)

  • This topic has 1 reply, 2 voices, and was last updated 4 months ago by Elvin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1513764
    Pieter

    Hello, everybody,

    As you can see on https://gpsites.co/niche/shop/ the categories are displayed next to each other.

    ALBUMS
    CLOTHING
    HOODIES
    MUSIC
    POSTERS
    SINGLES
    T-SHIRTS

    Now I would also like this on my website https://draadloos-beveiligd.nl/winkel/.

    Does anyone know how to set this up?

    Thanks in advance

    Pieter van Dulst
    The Netherlands

    #1513784
    Elvin
    Staff
    Customer Support

    Hi,

    Niche, by default adds a Hook Element named “Woocommerce Shop Category Menu”.

    It contains this PHP snippet.

    <?php
    $cat_args = array(
    	'orderby'    => 'name',
    	'order'      => 'asc',
    	'hide_empty' => true,
    );
     
    $product_categories = get_terms( 'product_cat', $cat_args );
     
    if ( ! empty( $product_categories ) ) {
    	echo '<ul class="woo-cat-nav">';
    		foreach ( $product_categories as $key => $category ) {
    			printf( 
    				'<li>
    					<a href="%1$s">
    						%2$s
    					</a>
    				</li>',
    				get_term_link( $category ),
    				$category->name
    			);
    		}
    	echo '</ul>';
    }
    ?>

    Here’s its hook and PHP execution setting:
    https://share.getcloudapp.com/JrugEjPz

    As for display rule setting:
    https://share.getcloudapp.com/wbuPxZjo

    A wise man once said:
    "Have you cleared your cache?"

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.