How to exclude category ID from Looper in WordPress

The solution is already in your code: <?php foreach (get_categories( $args ) as $cat ) : ?> <a class=”categorylink” href=”<?php echo get_category_link($cat->term_id); ?>”><img src=”<?php echo z_taxonomy_image_url($cat->term_id); ?>” /> More specifically: <?php foreach (get_categories( $args ) as $cat ) : ?> …get_category_link($cat->term_id)… That term_id is the ID of the category, so just test if it matches … Read more

Ajax category filtering products default show all

First, you should use the REST API for frontend instead of admin-ajax. Second, you should not use unfiltered POST values. And for your products on page load, you should tell your Javascript to fill the ID “response”, when the ID is present. Now, you only load products, when the click event on the class js-filter-item … Read more