WordPress.org

Ready to get started?Download WordPress

Forums

single_cat_title() problem in single.php (2 posts)

  1. KanIshigami
    Member
    Posted 9 years ago #

    When I use the function single_cat_title() inside the single.php template, it returns nothing. I'm using this to include a php code relative to post category.

    It's like this:

    <?php
    $categoria = single_cat_title('',false);
    $categoria_out = dirify($categoria);
    ?>

    This code work perfectly in category template, but in single post template I have this problem - single_cat_title() returns a null value.

    Sorry my english isn't very good. And tks...

  2. KanIshigami
    Member
    Posted 9 years ago #

    Well... I'll change the question. How I can display the category name in single.php template outside The Loop?

    Because the single_cat_title() doesn't work in single.php template. Anyone can help me? Please?

Topic Closed

This topic has been closed to new replies.

About this Topic