[Support request] On Niche Shop shows code

Home Forums Support [Support request] On Niche Shop shows code

Home Forums Support On Niche Shop shows code

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1145995
    Kapil

    I have installed Niche and on SHOP button the following appears:
    ‘name’, ‘order’ => ‘asc’, ‘hide_empty’ => true, ); $product_categories = get_terms( ‘product_cat’, $cat_args ); if ( ! empty( $product_categories ) ) { echo ‘
    ‘; foreach ( $product_categories as $key => $category ) { printf( ‘
    %2$S
    ‘, get_term_link( $category ), $category->name ); } echo ‘
    ‘; } ?>

    The products do show.
    Everything else is working fine.
    Can you guys point me to what might be a fix?
    Thanks,
    Kapil

    #1146239
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Sounds like one of your Hook Elements is missing some code.

    1. Go to Appearance > Elements, and open the “Woocommerce Shop Category Menu” Element.
    2. In the content area, replace the content with this:

    <?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>';
    }
    ?>

    3. Make sure “Execute PHP” is activated.

    Let me know if this helps or not 🙂

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