Title: Page Title Variable
Last modified: August 18, 2016

---

# Page Title Variable

 *  [Ecko](https://wordpress.org/support/users/ecko/)
 * (@ecko)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/page-title-variable/)
 * Just a quick one, I’ve had a look around but couldn’t see anything on it;
 * Basically I’m after the page title of the current page. the_title() function 
   gives this, but it prints it. I need to get hold of the title to work with as
   I wish to compare the page title to an array in order to set additional functions
   on certain pages. (ie if(in_array($page_title,$title_array)) { some_function();}
 * TIA

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/page-title-variable/#post-638579)
 * See the [Template Tag](http://codex.wordpress.org/Template_Tags), [get_the_title](http://codex.wordpress.org/Template_Tags/get_the_title).
 *  [KeithDonegan](https://wordpress.org/support/users/babyboy808/)
 * (@babyboy808)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/page-title-variable/#post-638898)
 * Thanks Michael, worked a treat.

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

The topic ‘Page Title Variable’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [KeithDonegan](https://wordpress.org/support/users/babyboy808/)
 * Last activity: [17 years, 8 months ago](https://wordpress.org/support/topic/page-title-variable/#post-638898)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
