1

In this line: $cats .= $category->name . ', '; You append a name of category to variable called $cats. But you never reset this variable. So every post appends its categories to the same variable. So here’s how to fix this: <?php $categories = get_the_terms($custom_args->ID, 'veranstaltungen-category'); $cats = ''; // set empty string as ...


1

I believe because: the_ID() : Display the ID of the current item in the WordPress Loop. and get_the_ID() : Retrieve the ID of the current item in the WordPress Loop. So the_ID() displays the post ID. Try to use get_the_ID()


Only top voted, non community-wiki answers of a minimum length are eligible