Support » Fixing WordPress » Display name of child category

  • Resolved Evita


    Does anybody know how to display the name of the current child category as title in category and single view (outside the loop)?
    To display the current category name I use following code:
    global $post;
    $my_cat_name = $wpdb->get_var("SELECT cat_name FROM $wpdb->categories, $wpdb->post2cat WHERE cat_ID = category_id AND post_id = $post->ID");
    echo strip_tags($my_cat_name);

    Thanks for any help, Evita

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Display name of child category’ is closed to new replies.