How to add a shortcode function that returns the taxonomy slug of the actual post within the loop

get_the_terms() will always return an array; but because you have only one ‘project_category’, you can simply use its first element: add_shortcode( ‘return_taxonomy_slug’, ‘my_shortcode_return_taxonomy_slug’ ); function my_shortcode_return_taxonomy_slug() { $terms = get_the_terms( get_the_ID(), ‘project_category’); return $terms[0]->slug; }

WordPress is adding “category” word before my actual category name in url (and this is unsolicited)

This should be a comment but I have not enough reputation yet, sorry for that… As Jacob said in his comment this is the normal behaviour. However this issue has already been discussed many times. Check this Q/A as an example: https://stackoverflow.com/questions/17798815/remove-category-tag-base-from-wordpress-url-without-a-plugin

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