Posted on

Remove Custom Taxonomy Link

If you created custom taxonomy and showing in table and you want to remove link then, use those code below.

if( !function_exists('wpt_remove_taxonomy_link') ){
	function wpt_remove_taxonomy_link(){
		?>
			<script>
				jQuery(document).ready(function($){
					$('.wpt_pa_color a,.wpt_pa_color a').contents().unwrap();
				});
			</script>
		<?php
	}
	add_action( 'wp_footer', 'wpt_remove_taxonomy_link' );
}

Replace (wpt_pa_color) classes with your own taxonomy classes.

Posted on

Show Table in Only Shop page

When we turn on ‘Table On Archives’ table will show on WooCommerce Archive/Category/Tag/Attribute page. But if you only want to show table on shop page, we can do this using filter hook.

if (!function_exists('wpt_show_table_only_shop')) {
	function wpt_show_table_only_shop($my_archive, $template){
		if(!is_shop()){
			return $template;
		}
		else{
			return $my_archive;
		}
	}
	add_filter('wpto_archvie_page_template_loc', 'wpt_show_table_only_shop', 10, 2);
}