Title: how to use function single_cat_title()
Last modified: August 19, 2016

---

# how to use function single_cat_title()

 *  [nobita](https://wordpress.org/support/users/nobita/)
 * (@nobita)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/how-to-use-function-single_cat_title/)
 * I want to show current category title
 * I found this page
    [http://codex.wordpress.org/Function_Reference/single_cat_title](http://codex.wordpress.org/Function_Reference/single_cat_title)
 * `<p><?php single_cat_title('Currently browsing '); ?>.</p>`
 * > Currently browsing WordPress.
 * I try this
 *     ```
       if(is_category()){
           $page_title = __("Category Archives :",'obandes');
       	$page_title = $page_title.single_cat_title('', false);
       //ok echo Category Archives : WordPress
       	$page_title = single_cat_title($page_title, false);
       //bad echo  WordPress
   
       }
   
       printf('<div class="h1" id="archives-title">%s</div>',esc_html($page_title));
       ```
   
 * I am search other example.
 * find twentyten category.php
 *     ```
       <h1 class="page-title"><?php
       	printf( __( 'Category Archives: %s', 'twentyten' ), '<span>' . single_cat_title( '', false ) . '</span>' );
       ?></h1>
       ```
   
 * Is this only my ploblem?
 * why I have not good result?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/how-to-use-function-single_cat_title/#post-1922034)
 * can you describe what your problem is?
 *  Thread Starter [nobita](https://wordpress.org/support/users/nobita/)
 * (@nobita)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/how-to-use-function-single_cat_title/#post-1922043)
 * Sorry alchymyth
 * function single_cat_title have 2 parameter.
    It is prefix and display parameter.
 * the prefix parameter is not work.
 * Can my explanation be understood?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/how-to-use-function-single_cat_title/#post-1922099)
 * this is either done on purpose, but undocumented, in the core files (/wp-includes/
   general-template.php), or an error.
 * the resp code snippet is here:
 *     ```
       750      if ( $display )
        751          echo $prefix . $term_name;
        752      else
        753          return $term_name;
        754  }
       ```
   
 * so – with the display parameter ‘false’ to return a string, the prefix is ommitted.
 * however, when you know this, you can simply program what you want, as you are
   working with strings anyway.
 *  Thread Starter [nobita](https://wordpress.org/support/users/nobita/)
 * (@nobita)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/how-to-use-function-single_cat_title/#post-1922126)
 * I understand Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘how to use function single_cat_title()’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [nobita](https://wordpress.org/support/users/nobita/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/how-to-use-function-single_cat_title/#post-1922126)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
