Title: php Question &#8211; camel caps?
Last modified: August 19, 2016

---

# php Question – camel caps?

 *  Resolved [nickaster](https://wordpress.org/support/users/nickaster/)
 * (@nickaster)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/php-question-camel-caps/)
 * Howdy – I figured out that the following code will spit out the name of my tag
   in a template:
 * <?php single_tag_title(); ?>
 * the problem is this spits the words out in all lower case. Is there some magic
   php to make it capitalize each word? so that “crazy stuff” spits out as “Crazy
   Stuff”.
 * Thanks!

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

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/php-question-camel-caps/#post-1217437)
 * PHP -> ucwords()
 * CSS -> text-transform:capitalize
 *  Thread Starter [nickaster](https://wordpress.org/support/users/nickaster/)
 * (@nickaster)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/php-question-camel-caps/#post-1217463)
 * umm… cool. so… CSS isn’t going to help because it’s the title field I’m working
   with. How would I go about sticking that ucwords thing in there? I know basically
   zero php.
 * Is it something like this?
 *     ```
       <?php
       $foo = single_tag_title();
       $foo = ucwords($foo);
       echo $foo;
       ?>
       ```
   
 * That’s a seriously illiterate guess…
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/php-question-camel-caps/#post-1217495)
 * That [looks about right](http://us.php.net/manual/en/function.ucwords.php), actually.
 *  Thread Starter [nickaster](https://wordpress.org/support/users/nickaster/)
 * (@nickaster)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/php-question-camel-caps/#post-1217591)
 * Hmm…. darn, doesn’t do anything. Oddly, it still returns the name of the tag 
   and doesn’t throw an error, but no caps. Must be something really simple I’m 
   doing wrong no?
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/php-question-camel-caps/#post-1217596)
 * Ok. This works.
 *     ```
       <?php
       $foo = single_tag_title("",false);
       $foo = ucwords($foo);
       echo $foo;
       ?>
       ```
   
 * You need the ‘false’ in order to shove the value into a variable.
 * However, it **only** works on tag archive pages.
 *  Thread Starter [nickaster](https://wordpress.org/support/users/nickaster/)
 * (@nickaster)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/php-question-camel-caps/#post-1217627)
 * Totally awesome. Thanks!
 *  [dtiger2k](https://wordpress.org/support/users/dtiger2k/)
 * (@dtiger2k)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/php-question-camel-caps/#post-1217628)
 * I know that this says resolved but I’m wondering if it’s still not css. I would
   open the style.css file in your template directory and search for “lowercase”.
   It may be that the div for that has a lowercase tag. It just seems like a styling
   issue to me.

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

The topic ‘php Question – camel caps?’ is closed to new replies.

 * 7 replies
 * 3 participants
 * Last reply from: [dtiger2k](https://wordpress.org/support/users/dtiger2k/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/php-question-camel-caps/#post-1217628)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
