I want to remove category class from blog post page. Suppose I have 2 category one is fashion and another one is business. in blog post wordpress add class like "category-fashion category-business" . I want to remove all the classes for each category. I tried using jquery but class name hide on inspect element but not in view source from browser. if possible I want to remove using function.php file. below is my jquery code.
<script>
jQuery(window).on("load", function() {
<?php
$categories = get_categories();
foreach($categories as $category) {
echo 'jQuery(".category-' . strtolower($category->name) .'").removeClass("category-'. strtolower($category->name) . '");';
}
?>
});
</script>
please try this code in your theme's functions.php file, hope it will work in the blog page's post class.
If you want to remove the classes from the body class then you can just replace the filter with this code