
Remove a comma from last item in categories list
I was developing a wordpress theme and came across this issue that my custom post type categories show comma at last category item. My code was like this:
So, by using rtrim and modifying code a bit; i was able to fix this problem. Below is my final code.
Please adjust your code accordingly to solve this issue.
Happy Coding!