How do I output all category with custom field?

Based on the code in your question, I can only see one problem.

  • under “Show all category links”, you’ve got an “endwhile”, but no “while”, and an “endif”, but no “if”. Delete both the “endwhile” and “endif” and the code runs fine.

The “Projects page code” works fine. I can’t reproduce your specific custom fields but then you didn’t flag them as an issue, so that shouldn’t be a problem. FWIW, “showposts” has been deprecated in favour of “posts_per_page” but it still works.