Title: Header excerpt
Last modified: August 19, 2016

---

# Header excerpt

 *  [nissepop](https://wordpress.org/support/users/nissepop/)
 * (@nissepop)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/header-excerpt/)
 * I would like to use like a “post header excerpt”.
    How do I do?
 * Like this:
    The original header, that shows on single.php: “This is a really 
   long post header” The header that shows on index.php: “This is a really…”
 * Please help!

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

 *  [Peter Boosten](https://wordpress.org/support/users/pboosten/)
 * (@pboosten)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/header-excerpt/#post-1261399)
 * Change `the_content(` into `the_excerpt(` in your index.php.
 * Peter
 *  Thread Starter [nissepop](https://wordpress.org/support/users/nissepop/)
 * (@nissepop)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/header-excerpt/#post-1261402)
 * I’ve allready done that.
    I want to “shorten” the header (<?php the_title(); ?
   >).
 * ???
 *  [Peter Boosten](https://wordpress.org/support/users/pboosten/)
 * (@pboosten)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/header-excerpt/#post-1261403)
 * Ah, you mean the title?
 * `<?php echo substr($post->post_title,19) . "..."; ?>`
 * Peter
 *  Thread Starter [nissepop](https://wordpress.org/support/users/nissepop/)
 * (@nissepop)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/header-excerpt/#post-1261413)
 * Thank you, but we aint there yet…
    <?php echo substr($post->post_title,19) . “…”;?
   > cuts the title from the wrong direction… From the beginning. Like this
 * Original title:
    “This is a really long post header” With yout script: “ng post
   header…”
 * 😉
 *  [Peter Boosten](https://wordpress.org/support/users/pboosten/)
 * (@pboosten)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/header-excerpt/#post-1261415)
 * ah, apologies:
 * `<?php echo substr($post->post_title,0,19) . "..."; ?>`
 * Peter
 *  [Peter Boosten](https://wordpress.org/support/users/pboosten/)
 * (@pboosten)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/header-excerpt/#post-1261417)
 * You should make it conditional, btw, or you’ll always stuck with those ‘…’:
 *     ```
       <?php
         if (strlen($post->post_title) >= 19 )
           echo substr($post->post_title,0,19) . "...";
         else
           echo $post->post_title;
       ?>
       ```
   
 * Peter
 *  Thread Starter [nissepop](https://wordpress.org/support/users/nissepop/)
 * (@nissepop)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/header-excerpt/#post-1261419)
 * Oh! Thank you very much!
 * Nils

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

The topic ‘Header excerpt’ is closed to new replies.

 * 7 replies
 * 2 participants
 * Last reply from: [nissepop](https://wordpress.org/support/users/nissepop/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/header-excerpt/#post-1261419)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
