I stuck again :)
After a search query in a specific Blog Category (with redirect to the main WP BLOG page) my search url looks like
.../online-shop/?s=&category=new-posts-category&post_type=post
Unfortunately, i'm not able to echo the category Name (new-posts-category) in the search Results page. I guess i tried all possible ways i found on the Wordpress Codex (like Codex - wich works fine by the way in my woocommerce search results) page so far. Any idea how to solve this issue?
EDIT:
The closest i came so far is (Source)
$categories = get_the_category();
// if ( ! empty( $categories ) ) {
echo esc_html( $categories[0]->name );
// }
But this one echoes the name of the first array element ([0]) of $categories. And i have no idea how to change this so it echos the current category name - it is by the way the only version wich outputs any result.
Try this within the post loop: