Problem with calling custom function in a foreach loop
First you need to pass the post_id to this function to use the post_id inside the get_the_category($post_id) function incomplete_cat_list($post_id = ”) { global $post; $post_id = ($post_id) ? $post_id : $post->ID; $first_time = 1; $categories = get_the_category($post_id); foreach($categories as $category) { if ($category->cat_name != ‘Category Name’) { if ($first_time == 1) { echo ‘<a class=”cat-list” … Read more