WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Display name of child category

[Resolved] Display name of child category

  • 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:
    <?php
    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 ‘[Resolved] Display name of child category’ is closed to new replies.
Skip to toolbar