Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a dilemma, well a new blog which im developing and a few of the posts titles are like this 'Tutorial: Build your first App' or 'Tutorial: Start your business with xensuithia'

I have a page called tutorials that display the posts from this category.

I need the title to not display the 'Tutorial:' part on this page, I tried:

str_replace('Tutorial:',' ', the_title()); 

However it does not work. It just outputs the full title.

share|improve this question
    
this is not a WordPress question at all. you need to do something like $cut_title = str_replace('Tutorial:',' ', the_title()); echo $cut_title; (I've flagged to close this question) –  anu Mar 31 '11 at 14:21
    
grrr - as Markus points out, it should be get_the_title() –  anu Mar 31 '11 at 14:29
1  
Yeah, it is a WP question. It's about the_title() (and by inference, get_the_title(). –  Dougal Campbell Mar 31 '11 at 15:31

1 Answer 1

up vote 4 down vote accepted

That's because the_title() echoes the title. Use this instead:

echo str_replace( 'Tutorial: ', '', get_the_title() );
share|improve this answer
    
None of these work :'( –  Mark Petherbridge Mar 31 '11 at 14:27
    
What's the problem exactly? –  Marcus Kober Mar 31 '11 at 14:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.