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.

when creating pages, the title normally show as a link and as a title on the page it displayed when click on. My question is how do i remove the title from displaying on my page. for example when a page like "contact us" is created, the page itself will have "contact us" display in either h1 or h2 tag. how do i make the "contact us" on the page not to display.

share|improve this question

2 Answers 2

Set the title as 'Contact'. Then use the following code:

add_filter('the_title','remove_title');

function remove_title($title) {
    if( !is_page('Contact') ) {
        return $title;
    }
}

Put this code in your functions.php file.

share|improve this answer

A code I often use (as an example is as follows):

<?php if (is_front_page()): ?>
<h1><?php _e('My Custom Page Title', '<YOUR LOC DOMAIN>'); ?></h1> <!-- Or leave blank -->
<?php else: ?>
<h1 class="entry-title"><?php the_title(); ?></h1> 
<?php endif; ?>

This will allow you to use whatever page title you wish or none at all on certain pages. You can search the WordPress Codex for alternatives to is_front_page such as a page or ID.

share|improve this answer
    
Do you really use so messy code? If you use it so often, couldn't you tidy it up a little bit? (see my edits). –  Krzysiek Dróżdż Dec 5 '13 at 9:18

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.