How do I get the custom category URL from the custom post type?

Once you have the post’s term(s) (see get_the_terms) you can use get_term_link to get the term’s link:

 $url = get_term_link('category-1','portfolio-categories');

You can pass the term object, the term slug, or the term ID. If you pass the term ID it must be cast as an integer.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)